[fix] no longer requiring argv for unicode_properties script
This commit is contained in:
@@ -35,10 +35,12 @@ from geodata.string_utils import NUM_CODEPOINTS, wide_unichr
|
||||
|
||||
from cldr_languages import *
|
||||
from download_cldr import download_cldr
|
||||
from languages import init_languages, get_country_languages
|
||||
from languages import get_country_languages
|
||||
from unicode_paths import UNICODE_DATA_DIR
|
||||
from word_breaks import script_regex, regex_char_range
|
||||
|
||||
SRC_DIR = os.path.join(this_dir, os.pardir, os.pardir, os.pardir, 'src')
|
||||
|
||||
SCRIPTS_DATA_DIR = os.path.join(UNICODE_DATA_DIR, 'scripts')
|
||||
LOCAL_SCRIPTS_FILE = os.path.join(SCRIPTS_DATA_DIR, 'Scripts.txt')
|
||||
LOCAL_ISO_15924_FILE = os.path.join(SCRIPTS_DATA_DIR, 'iso15924.txt')
|
||||
@@ -395,13 +397,11 @@ def get_script_languages():
|
||||
return script_languages
|
||||
|
||||
|
||||
def main(out_dir):
|
||||
def main(out_dir=SRC_DIR):
|
||||
# Output is a C header and data file, see templates
|
||||
out_file = open(os.path.join(out_dir, SCRIPTS_DATA_FILENAME), 'w')
|
||||
out_header = open(os.path.join(out_dir, SCRIPTS_HEADER), 'w')
|
||||
|
||||
init_languages()
|
||||
|
||||
download_file(SCRIPTS_URL, LOCAL_SCRIPTS_FILE)
|
||||
download_file(BLOCKS_URL, LOCAL_BLOCKS_FILE)
|
||||
download_file(PROPS_URL, LOCAL_PROPS_FILE)
|
||||
@@ -459,8 +459,4 @@ def main(out_dir):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2:
|
||||
print 'Usage: python unicode_properties.py out_dir'
|
||||
sys.exit(1)
|
||||
|
||||
main(sys.argv[1])
|
||||
main(*sys.argv[1:])
|
||||
|
||||
Reference in New Issue
Block a user