-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
58 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.python-version | ||
typediff/config.py | ||
typediff/settings.py | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +0,0 @@ | ||
import os | ||
import sys | ||
|
||
from . import config | ||
|
||
root_dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
# default params | ||
ACEBIN = os.path.join(root_dir, 'bin', 'ace') | ||
TYPIFIERBIN = os.path.join(root_dir, 'bin', 'typifier') | ||
DUMPHIERARCHYBIN = os.path.join(root_dir, 'bin', 'dumphierarchy') | ||
JSONPATH = os.path.join(root_dir, 'www', 'json') | ||
LOGPATH = os.path.join('ace.log') | ||
|
||
|
||
# update any values from user config if set | ||
|
||
params = [ | ||
'ACEBIN', | ||
'JSONPATH', | ||
'LOGPATH', | ||
] | ||
|
||
for param in params: | ||
if hasattr(config, param): | ||
value = getattr(config, param) | ||
setattr(sys.modules[__name__], param, value) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import os | ||
import sys | ||
|
||
from . import settings | ||
|
||
ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
# default params | ||
ACEBIN = os.path.join(ROOT_PATH, 'bin', 'ace') | ||
TYPIFIERBIN = os.path.join(ROOT_PATH, 'bin', 'typifier') | ||
DUMPHIERARCHYBIN = os.path.join(ROOT_PATH, 'bin', 'dumphierarchy') | ||
LOGPATH = os.path.join('ace.log') | ||
|
||
# The order types are to be displayed in the output list and their | ||
# color value for terminal output and web interface output | ||
# repectively. | ||
# | ||
# format = (super_type_name, terminal_color, web_color) | ||
# | ||
# terminal_color must be one of {white, cyan, purple, blue, | ||
# yellow, green, red} | ||
# | ||
# web_color can be any valid CSS color string | ||
TYPES = ( | ||
('sign', 'rgba(255, 0, 0, 0.65)', 'red'), | ||
('synsem', 'rgba(0, 128, 0, 0.65)', 'green'), | ||
('head', 'rgba(128, 0, 128, 0.65)', 'blue'), | ||
('cat', 'rgba(0, 0, 255, 0.65)', 'purple'), | ||
('relation', 'rgba(0, 255, 255, 0.65)', 'cyan'), | ||
('predsort', 'rgba(255, 255, 0, 0.65)', 'yellow'), | ||
('other', 'rgba(255, 255, 255, 1.00)', 'white'), | ||
) | ||
|
||
|
||
# get other values from settings any already defined above will be overridden | ||
|
||
PARAMS = [ | ||
'DATAPATH', | ||
'LOGONROOT', | ||
'FANGORNPATH', | ||
'LTDBPATH', | ||
'ACESRC', | ||
'GRAMMARLIST', | ||
'TREEBANKLIST', | ||
'ACEBIN', | ||
'JSONPATH', | ||
'LOGPATH', | ||
] | ||
|
||
for param in PARAMS: | ||
if hasattr(settings, param): | ||
setattr(sys.modules[__name__], param, getattr(settings, param)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters