Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
spnati
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPNATI Utilities Bot
spnati
Commits
41df6f8a
Commit
41df6f8a
authored
7 years ago
by
Master-Fate
Browse files
Options
Downloads
Patches
Plain Diff
Allow multiple args for line counting tool
parent
664c993f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opponents/xml_unique_line_counter.py
+12
-3
12 additions, 3 deletions
opponents/xml_unique_line_counter.py
with
12 additions
and
3 deletions
opponents/xml_unique_line_counter.py
+
12
−
3
View file @
41df6f8a
...
...
@@ -2,9 +2,13 @@
# To generate a unique line count for a single character (use -f or --file):
# python xml_unique_line_counter.py -f path\to\character\behaviour.xml
# Note that you can use wildcards to process multiple characters at once:
# Note that you can use wildcards to process multiple
related
characters at once:
# python xml_unique_line_counter.py -f path\to\a*\behaviour.xml
# (This will process all character directories which begin with a)
# (This will process all character directories which begin with the letter 'a')
# To generate a unique line count for multiple unrelated characters (use -F or --files):
# python xml_unique_line_counter.py -F "path\to\character1\behaviour.xml path\to\character2\behaviour.xml"
# (IMPORTANT: The paths must be enclosed in quotes AND the paths must NOT contain spaces)
# (You can also use wildcards with this flag as well)
# To turn on verbose (debugging) output (use -v or --verbose):
# python xml_unique_line_counter.py -f path\to\character\behaviour.xml -v
# To specify a different output directory (use -o or --output):
...
...
@@ -65,12 +69,17 @@ if __name__ == '__main__':
output_dir
=
os
.
path
.
dirname
(
__file__
)
argv
=
sys
.
argv
[
1
:]
opts
,
args
=
getopt
.
getopt
(
argv
,
"
d:vf:o:s
"
,
[
"
download=
"
,
"
verbose
"
,
"
file=
"
,
"
output=
"
,
"
sortfreq
"
])
opts
,
args
=
getopt
.
getopt
(
argv
,
"
d:vf:
F:
o:s
"
,
[
"
download=
"
,
"
verbose
"
,
"
file=
"
,
"
File=
"
,
"
output=
"
,
"
sortfreq
"
])
for
opt
,
arg
in
opts
:
if
opt
in
(
"
-v
"
,
"
--verbose
"
):
verbose
=
True
elif
opt
in
(
"
-f
"
,
"
--file
"
):
file_
=
glob
(
arg
)
elif
opt
in
(
"
-F
"
,
"
--files
"
):
file_
=
[]
file_args
=
arg
.
split
(
"
"
)
for
fa
in
file_args
:
file_
.
extend
(
glob
(
fa
))
elif
opt
in
(
"
-o
"
,
"
--output
"
):
output_dir
=
arg
elif
opt
in
(
"
-s
"
,
"
--sortfreq
"
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment