Index: spongenet/trunk/mini_andi_expand_config.py =================================================================== --- (revision ) +++ spongenet/trunk/mini_andi_expand_config.py (revision 344) @@ -1,0 +1,15 @@ +#!/usr/bin/env python + +"""Expand module config for mini_andi platform.""" + +import os + +zipdir = "/seacoos/data/nccoos/level0/largo/mini_andi/zip" +xmldir = "/seacoos/data/nccoos/level0/largo/mini_andi/xml" +zipdir_pattern = "[0-9][0-9][0-9][0-9]_[0-9][0-9]" +zipfile_pattern = "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T" \ + "[0-9][0-9][0-9][0-9][0-9][0-9]-" \ + "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T" \ + "[0-9][0-9][0-9][0-9][0-9][0-9].zip" +xmlfile_pattern = "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T" \ + "[0-9][0-9][0-9][0-9][0-9][0-9].xml" Index: spongenet/trunk/spongenet/__init.py__ =================================================================== --- spongenet/trunk/spongenet/__init.py__ (revision 337) +++ spongenet/trunk/spongenet/__init.py__ (revision 344) @@ -1,1 +1,3 @@ +#!/usr/bin/env python + """Package to process sponge data files.""" Index: spongenet/trunk/spongenet/expand.py =================================================================== --- spongenet/trunk/spongenet/expand.py (revision 343) +++ spongenet/trunk/spongenet/expand.py (revision 344) @@ -1,2 +1,4 @@ +#!/usr/bin/env python + """ Expand zipped sponge data files. @@ -28,6 +30,6 @@ from StringIO import StringIO -usage = "\n".join(__doc__.splitlines()[3:8]) -test_path = "tests/expand" +USAGE = "\n".join(__doc__.splitlines()[3:8]) +TEST_PATH = "tests/expand" @@ -61,5 +63,5 @@ >>> _config_path = config_path() >>> sys.stdout = save_stdout - >>> usage == temp_stdout.getvalue()[:-1] + >>> USAGE == temp_stdout.getvalue()[:-1] True @@ -72,5 +74,5 @@ >>> _config_path = config_path() >>> sys.stdout = save_stdout - >>> usage == temp_stdout.getvalue()[:-1] + >>> USAGE == temp_stdout.getvalue()[:-1] True @@ -83,9 +85,9 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path) + ... TEST_PATH) >>> sys.argv = ["", _config_path] >>> _config_path = config_path() >>> sys.stdout = save_stdout - >>> usage == temp_stdout.getvalue()[:-1] + >>> USAGE == temp_stdout.getvalue()[:-1] True @@ -98,9 +100,9 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "xxxxx") + ... TEST_PATH, "xxxxx") >>> sys.argv = ["", _config_path] >>> _config_path = config_path() >>> sys.stdout = save_stdout - >>> usage == temp_stdout.getvalue()[:-1] + >>> USAGE == temp_stdout.getvalue()[:-1] True @@ -110,5 +112,5 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "config.py") + ... TEST_PATH, "config.py") >>> sys.argv = ["", _config_path] >>> _config_path == config_path() @@ -132,5 +134,5 @@ raise IOError("Incorrect number of arguments supplied.") except IOError: - print usage + print USAGE return path @@ -145,5 +147,5 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "empty_config.py") + ... TEST_PATH, "empty_config.py") >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ config(_config_path) @@ -162,9 +164,9 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "xxxxx") + ... TEST_PATH, "xxxxx") >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ config(_config_path) >>> sys.stdout = save_stdout - >>> usage == temp_stdout.getvalue()[:-1] + >>> USAGE == temp_stdout.getvalue()[:-1] True >>> zipdir @@ -182,9 +184,9 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "bad_config.py") + ... TEST_PATH, "bad_config.py") >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ config(_config_path) >>> sys.stdout = save_stdout - >>> usage == temp_stdout.getvalue()[:-1] + >>> USAGE == temp_stdout.getvalue()[:-1] True >>> @@ -200,12 +202,12 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "config.py") + ... TEST_PATH, "config.py") >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ config(_config_path) >>> zipdir == os.path.join(os.path.dirname(os.path.abspath(__file__)), - ... test_path, "zip") + ... TEST_PATH, "zip") True >>> xmldir == os.path.join(os.path.dirname(os.path.abspath(__file__)), - ... test_path, "xml") + ... TEST_PATH, "xml") True >>> zipdir_pattern == "[0-9][0-9][0-9][0-9]_[0-9][0-9]" @@ -230,7 +232,7 @@ execfile(path, globals(), namespace) except IOError: - print usage + print USAGE except SyntaxError: - print usage + print USAGE return (namespace["zipdir"], namespace["xmldir"], @@ -249,5 +251,5 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "xmlref") + ... TEST_PATH, "xmlref") >>> xmlref = glob.glob(os.path.join(xmlref_path, "*")) >>> xmlref_path = [path for path in xmlref if os.path.isdir(path)][0] @@ -255,5 +257,5 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "xmltest") + ... TEST_PATH, "xmltest") >>> if os.path.exists(xmltest_path): ... shutil.rmtree(xmltest_path) @@ -313,5 +315,5 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "config.py") + ... TEST_PATH, "config.py") >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ config(_config_path) @@ -322,6 +324,6 @@ ... os.path.dirname( ... os.path.abspath(__file__)), - ... test_path, "xmlref") - >>> ref_paths = sorted(glob.glob(os.path.join(test_path, "xmlref", + ... TEST_PATH, "xmlref") + >>> ref_paths = sorted(glob.glob(os.path.join(TEST_PATH, "xmlref", ... "*", "*.ref"))) >>> xml_paths = sorted(glob.glob(os.path.join(xmldir, "*", "*.xml"))) Index: spongenet/trunk/spongenet/tests/__init.py__ =================================================================== --- (revision ) +++ spongenet/trunk/spongenet/tests/__init.py__ (revision 344) @@ -1,0 +1,3 @@ +#!/usr/bin/env python + +"""Package to test sponge data file processing.""" Index: spongenet/trunk/spongenet/tests/expand/__init.py__ =================================================================== --- (revision ) +++ spongenet/trunk/spongenet/tests/expand/__init.py__ (revision 344) @@ -1,0 +1,3 @@ +#!/usr/bin/env python + +"""Package to test sponge data file expansion.""" Index: spongenet/trunk/spongenet/tests/expand/bad_config.py =================================================================== --- spongenet/trunk/spongenet/tests/expand/bad_config.py (revision 337) +++ spongenet/trunk/spongenet/tests/expand/bad_config.py (revision 344) @@ -1,2 +1,4 @@ +#!/usr/bin/env python + """Bad test configuration for the expand module.""" Index: spongenet/trunk/spongenet/tests/expand/config.py =================================================================== --- spongenet/trunk/spongenet/tests/expand/config.py (revision 337) +++ spongenet/trunk/spongenet/tests/expand/config.py (revision 344) @@ -1,2 +1,4 @@ +#!/usr/bin/env python + """Valid test configuration for the expand module.""" Index: spongenet/trunk/spongenet/tests/expand/empty_config.py =================================================================== --- spongenet/trunk/spongenet/tests/expand/empty_config.py (revision 337) +++ spongenet/trunk/spongenet/tests/expand/empty_config.py (revision 344) @@ -1,1 +1,3 @@ +#!/usr/bin/env python + """Empty test configuration for the expand module."""