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
47d2b8ab
Commit
47d2b8ab
authored
Aug 14, 2015
by
Steve Goering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix command dir not found error
parent
cd1bda40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
libs/lib.py
libs/lib.py
+1
-0
webis.py
webis.py
+15
-1
No files found.
libs/lib.py
View file @
47d2b8ab
...
...
@@ -9,6 +9,7 @@
import
os
import
argparse
class
AliasedSubParsersAction
(
argparse
.
_SubParsersAction
):
""" Based on : https://gist.github.com/sampsyo/471779 """
class
_AliasedPseudoAction
(
argparse
.
Action
):
...
...
webis.py
View file @
47d2b8ab
...
...
@@ -33,8 +33,21 @@ def check_commands_alias_definition(config):
def
load_config
():
"""Returns the configuration, based on the JSON configuration file."""
try
:
return
json
.
loads
(
read_file
(
os
.
path
.
dirname
(
config
=
json
.
loads
(
read_file
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"/config.json"
))
if
not
os
.
path
.
isdir
(
config
[
"commands_directory"
]):
config
[
"commands_directory"
]
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"/"
+
config
[
"commands_directory"
]
if
not
os
.
path
.
isdir
(
config
[
"commands_directory"
]):
lError
(
"moduls_directory {} is not a valid directory, "
"check config.json"
.
format
(
config
[
"commands_directory"
]))
sys
.
exit
(
1
)
return
config
except
Exception
as
e
:
lError
(
"The file config.json is invalid."
)
sys
.
exit
(
1
)
...
...
@@ -98,6 +111,7 @@ def run_subcommand(subcommand, subcommandpath, params=[]):
lError
(
"An error occurred while executing "
+
cmd
)
return
return_value
def
translate_alias_to_command
(
config
,
alias
):
"""Transforms a given alias to the unique command."""
for
command
in
config
[
"commands_aliases"
]:
...
...
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