NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 344

Show
Ignore:
Timestamp:
08/26/10 14:58:50
Author:
cbc
Message:

Add more package management and she-bang lines.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spongenet/trunk/spongenet/__init.py__

    r337 r344  
     1#!/usr/bin/env python 
     2 
    13"""Package to process sponge data files.""" 
  • spongenet/trunk/spongenet/expand.py

    r343 r344  
     1#!/usr/bin/env python 
     2 
    13""" 
    24Expand zipped sponge data files. 
     
    2830from StringIO import StringIO 
    2931 
    30 usage = "\n".join(__doc__.splitlines()[3:8]) 
    31 test_path = "tests/expand" 
     32USAGE = "\n".join(__doc__.splitlines()[3:8]) 
     33TEST_PATH = "tests/expand" 
    3234 
    3335 
     
    6163    >>> _config_path = config_path() 
    6264    >>> sys.stdout = save_stdout 
    63     >>> usage == temp_stdout.getvalue()[:-1] 
     65    >>> USAGE == temp_stdout.getvalue()[:-1] 
    6466    True 
    6567 
     
    7274    >>> _config_path = config_path() 
    7375    >>> sys.stdout = save_stdout 
    74     >>> usage == temp_stdout.getvalue()[:-1] 
     76    >>> USAGE == temp_stdout.getvalue()[:-1] 
    7577    True 
    7678 
     
    8385    ...                    os.path.dirname( 
    8486    ...                        os.path.abspath(__file__)), 
    85     ...                    test_path
     87    ...                    TEST_PATH
    8688    >>> sys.argv = ["", _config_path] 
    8789    >>> _config_path = config_path() 
    8890    >>> sys.stdout = save_stdout 
    89     >>> usage == temp_stdout.getvalue()[:-1] 
     91    >>> USAGE == temp_stdout.getvalue()[:-1] 
    9092    True 
    9193 
     
    98100    ...                    os.path.dirname( 
    99101    ...                        os.path.abspath(__file__)), 
    100     ...                    test_path, "xxxxx") 
     102    ...                    TEST_PATH, "xxxxx") 
    101103    >>> sys.argv = ["", _config_path] 
    102104    >>> _config_path = config_path() 
    103105    >>> sys.stdout = save_stdout 
    104     >>> usage == temp_stdout.getvalue()[:-1] 
     106    >>> USAGE == temp_stdout.getvalue()[:-1] 
    105107    True 
    106108 
     
    110112    ...                    os.path.dirname( 
    111113    ...                        os.path.abspath(__file__)), 
    112     ...                    test_path, "config.py") 
     114    ...                    TEST_PATH, "config.py") 
    113115    >>> sys.argv = ["", _config_path] 
    114116    >>> _config_path == config_path() 
     
    132134            raise IOError("Incorrect number of arguments supplied.") 
    133135    except IOError: 
    134         print usage 
     136        print USAGE 
    135137    return path 
    136138 
     
    145147    ...                    os.path.dirname( 
    146148    ...                        os.path.abspath(__file__)), 
    147     ...                    test_path, "empty_config.py") 
     149    ...                    TEST_PATH, "empty_config.py") 
    148150    >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ 
    149151            config(_config_path) 
     
    162164    ...                    os.path.dirname( 
    163165    ...                        os.path.abspath(__file__)), 
    164     ...                    test_path, "xxxxx") 
     166    ...                    TEST_PATH, "xxxxx") 
    165167    >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ 
    166168            config(_config_path) 
    167169    >>> sys.stdout = save_stdout 
    168     >>> usage == temp_stdout.getvalue()[:-1] 
     170    >>> USAGE == temp_stdout.getvalue()[:-1] 
    169171    True 
    170172    >>> zipdir 
     
    182184    ...                    os.path.dirname( 
    183185    ...                        os.path.abspath(__file__)), 
    184     ...                    test_path, "bad_config.py") 
     186    ...                    TEST_PATH, "bad_config.py") 
    185187    >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ 
    186188            config(_config_path) 
    187189    >>> sys.stdout = save_stdout 
    188     >>> usage == temp_stdout.getvalue()[:-1] 
     190    >>> USAGE == temp_stdout.getvalue()[:-1] 
    189191    True 
    190192    >>> 
     
    200202    ...                    os.path.dirname( 
    201203    ...                        os.path.abspath(__file__)), 
    202     ...                    test_path, "config.py") 
     204    ...                    TEST_PATH, "config.py") 
    203205    >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ 
    204206            config(_config_path) 
    205207    >>> zipdir == os.path.join(os.path.dirname(os.path.abspath(__file__)), 
    206     ...                        test_path, "zip") 
     208    ...                        TEST_PATH, "zip") 
    207209    True 
    208210    >>> xmldir == os.path.join(os.path.dirname(os.path.abspath(__file__)), 
    209     ...                        test_path, "xml") 
     211    ...                        TEST_PATH, "xml") 
    210212    True 
    211213    >>> zipdir_pattern == "[0-9][0-9][0-9][0-9]_[0-9][0-9]" 
     
    230232        execfile(path, globals(), namespace) 
    231233    except IOError: 
    232         print usage 
     234        print USAGE 
    233235    except SyntaxError: 
    234         print usage 
     236        print USAGE 
    235237    return (namespace["zipdir"], 
    236238            namespace["xmldir"], 
     
    249251    ...                   os.path.dirname( 
    250252    ...                       os.path.abspath(__file__)), 
    251     ...                   test_path, "xmlref") 
     253    ...                   TEST_PATH, "xmlref") 
    252254    >>> xmlref = glob.glob(os.path.join(xmlref_path, "*")) 
    253255    >>> xmlref_path = [path for path in xmlref if os.path.isdir(path)][0] 
     
    255257    ...                    os.path.dirname( 
    256258    ...                        os.path.abspath(__file__)), 
    257     ...                    test_path, "xmltest") 
     259    ...                    TEST_PATH, "xmltest") 
    258260    >>> if os.path.exists(xmltest_path): 
    259261    ...     shutil.rmtree(xmltest_path) 
     
    313315    ...                    os.path.dirname( 
    314316    ...                        os.path.abspath(__file__)), 
    315     ...                    test_path, "config.py") 
     317    ...                    TEST_PATH, "config.py") 
    316318    >>> zipdir,xmldir,zipdir_pattern,zipfile_pattern,xmlfile_pattern = \ 
    317319            config(_config_path) 
     
    322324    ...                   os.path.dirname( 
    323325    ...                       os.path.abspath(__file__)), 
    324     ...                   test_path, "xmlref") 
    325     >>> ref_paths = sorted(glob.glob(os.path.join(test_path, "xmlref", 
     326    ...                   TEST_PATH, "xmlref") 
     327    >>> ref_paths = sorted(glob.glob(os.path.join(TEST_PATH, "xmlref", 
    326328    ...                                           "*", "*.ref"))) 
    327329    >>> xml_paths = sorted(glob.glob(os.path.join(xmldir, "*", "*.xml"))) 
  • spongenet/trunk/spongenet/tests/expand/bad_config.py

    r337 r344  
     1#!/usr/bin/env python 
     2 
    13"""Bad test configuration for the expand module.""" 
    24 
  • spongenet/trunk/spongenet/tests/expand/config.py

    r337 r344  
     1#!/usr/bin/env python 
     2 
    13"""Valid test configuration for the expand module.""" 
    24 
  • spongenet/trunk/spongenet/tests/expand/empty_config.py

    r337 r344  
     1#!/usr/bin/env python 
     2 
    13"""Empty test configuration for the expand module."""