Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
code-webis-cmd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
code-generic
code-webis-cmd
Commits
f6ea8ff7
Commit
f6ea8ff7
authored
Aug 14, 2015
by
Steve Goering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style checks
parent
d42186b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
config.json
config.json
+3
-1
tools/core/fun.py
tools/core/fun.py
+2
-4
webis.py
webis.py
+12
-10
No files found.
config.json
View file @
f6ea8ff7
{
"moduls_directory"
:
"tools/"
,
"allowed_scripts"
:
[
"python"
,
"bash"
],
"ignored_dirs"
:
[
"CVS"
]
"ignored_dirs"
:
[
"CVS"
],
"update"
:
"core/update.sh"
,
"version"
:
"core/version.sh"
}
\ No newline at end of file
tools/core/fun.py
View file @
f6ea8ff7
...
...
@@ -28,13 +28,11 @@ def get_random_msg():
return
unescape
(
output
)
def
main
(
params
):
print
(
get_random_msg
())
print
(
"
\n\n
"
)
max_i
=
shutil
.
get_terminal_size
().
columns
for
j
in
range
(
3
):
for
i
in
range
(
0
,
max_i
):
...
...
webis.py
View file @
f6ea8ff7
...
...
@@ -8,10 +8,11 @@ Authors: Steve Göring, Martin Potthast
import
argparse
import
collections
import
json
import
loader
import
os
import
sys
import
loader
from
lib
import
*
from
log
import
*
from
system
import
*
...
...
@@ -34,7 +35,7 @@ def get_commands(config):
# renamed to "command".
for
directory
in
os
.
listdir
(
config
[
"moduls_directory"
]):
if
(
os
.
path
.
isdir
(
config
[
"moduls_directory"
]
+
directory
)
and
directory
not
in
config
[
"ignored_dirs"
]):
directory
not
in
config
[
"ignored_dirs"
]):
commands
[
directory
]
=
config
[
"moduls_directory"
]
+
directory
return
commands
...
...
@@ -101,8 +102,8 @@ def main(args):
# TODO: It is conceivable to introduce aliases for each command, but it
# is unclear where to obtain them. Simply using a prefix does not
# work for betamng and betaweb, since they share a long prefix.
commandparser
=
commandparsers
.
add_parser
(
command
,
help
=
'TODO: Help message for commands.'
)
commandparser
=
commandparsers
.
add_parser
(
command
,
help
=
'TODO: Help message for commands.'
)
subparsers
[
command
]
=
commandparser
subcommandparsers
=
commandparser
.
add_subparsers
(
metavar
=
'<subcommand>'
,
dest
=
'<subcommand>'
,
...
...
@@ -112,7 +113,7 @@ def main(args):
for
subcommand
in
subcommands
:
subcommandparser
=
subcommandparsers
.
add_parser
(
subcommand
,
help
=
str
(
get_subcommand_help
(
subcommands
[
subcommand
])),
get_subcommand_help
(
subcommands
[
subcommand
])),
add_help
=
False
)
subparsers
[
subcommand
]
=
subcommandparser
...
...
@@ -123,15 +124,16 @@ def main(args):
parseresults
=
parser
.
parse_known_args
(
args
)
argsdict
=
vars
(
parseresults
[
0
])
parameter
=
parseresults
[
1
]
if
len
(
argsdict
)
==
2
and
argsdict
[
'<subcommand>'
]
==
None
:
if
len
(
argsdict
)
==
2
and
argsdict
[
'<subcommand>'
]
is
None
:
subparsers
[
argsdict
[
'<command>'
]].
print_help
()
return
0
return
run_subcommand
(
argsdict
[
'<subcommand>'
],
allcommands
[
argsdict
[
'<command>'
]][
argsdict
[
'<subcommand>'
]],
parameter
)
return
run_subcommand
(
argsdict
[
'<subcommand>'
],
allcommands
[
argsdict
[
'<command>'
]][
argsdict
[
'<subcommand>'
]],
parameter
)
if
__name__
==
"__main__"
:
sys
.
exit
(
main
(
sys
.
argv
[
1
:]))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment