Changeset 246


Ignore:
Timestamp:
08/03/2010 10:48:52 AM (12 years ago)
Author:
marcus
Message:

Refactoring (see also revision r245)

Location:
SHX/trunk/src/SeismicHandler
Files:
4 added
9 edited
9 moved

Legend:

Unmodified
Added
Removed
  • SHX/trunk/src/SeismicHandler/commands/echo.py

    r244 r246  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.command import BaseCommand 
     18from SeismicHandler.core.modules.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
  • SHX/trunk/src/SeismicHandler/commands/echo_ch.py

    r244 r246  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.command import BaseCommand 
     18from SeismicHandler.core.modules.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
  • SHX/trunk/src/SeismicHandler/commands/reads.py

    r244 r246  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.command import BaseCommand 
     18from SeismicHandler.core.modules.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
  • SHX/trunk/src/SeismicHandler/commands/sdef.py

    r244 r246  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.command import BaseCommand 
     18from SeismicHandler.core.modules.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
  • SHX/trunk/src/SeismicHandler/commands/sdel.py

    r244 r246  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.command import BaseCommand 
     18from SeismicHandler.core.modules.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
  • SHX/trunk/src/SeismicHandler/commands/switch.py

    r244 r246  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.command import BaseCommand 
     18from SeismicHandler.core.modules.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
  • SHX/trunk/src/SeismicHandler/core/__init__.py

    r244 r246  
    2222#print "it's __init__ from core" 
    2323 
    24 from SeismicHandler.core.traces import traces as t 
    25 from SeismicHandler.core.history import History as history 
    26 from SeismicHandler.core import codes 
    27 from SeismicHandler.core.log import Logging 
    28 from SeismicHandler.core.runtime import runtime 
    29  
     24import SeismicHandler.core.modules.parser as parser 
     25from SeismicHandler.core.modules.traces import traces as t 
     26from SeismicHandler.core.modules.history import History as history 
     27from SeismicHandler.core.basic import codes 
     28from SeismicHandler.core.modules.log import Logging 
     29from SeismicHandler.core.modules.runtime import runtime 
    3030 
    3131Settings = runtime() 
  • SHX/trunk/src/SeismicHandler/core/commands/__init__.py

    r244 r246  
    4646        import os 
    4747        import fnmatch 
    48         from SeismicHandler.core.log import logging 
     48        from SeismicHandler.core.modules.log import logging 
    4949 
    5050        logger = logging.getLogger("core.commands") 
  • SHX/trunk/src/SeismicHandler/core/modules/parser.py

    r244 r246  
    3131import re 
    3232import inspect 
    33 from SeismicHandler.core import Settings, Logging 
     33import SeismicHandler.core as shcore 
    3434import SeismicHandler.commands as commands 
    3535 
     
    113113 
    114114        converted = False 
    115         if Settings.swCapconv: 
     115        if shcore.Settings.swCapconv: 
    116116            # If a command starts with @, no conversion to upper case is 
    117117            # performed but the indicator char is removed. 
     
    208208    >>> strm = StringIO("echo line1\\necho line2\\n") 
    209209    >>> symb = symbol() 
    210     >>> Settings.swEcho = True 
     210    >>> shcore.Settings.swEcho = True 
    211211    >>> x = script(strm, symb) 
    212212    >>> x.run() 
     
    257257                    inputdata = inputdata + ".SHC" 
    258258 
    259                 if Settings.swCapconv: 
     259                if shcore.Settings.swCapconv: 
    260260                    inputdata = inputdata.upper() 
    261261 
     
    322322    def traceBack(self, error, msg = ""): 
    323323        # Respect global settings: 
    324         if Settings.swSherrstop: 
     324        if shcore.Settings.swSherrstop: 
    325325            import sys 
    326326            print >> sys.stderr, error, msg 
    327327            quit() 
    328328 
    329         if Settings.swCmderrstop: 
     329        if shcore.Settings.swCmderrstop: 
    330330            raise Exception(error, msg) 
    331331 
    332         if not Settings.swNoerrmsg: 
     332        if not shcore.Settings.swNoerrmsg: 
    333333            import warnings 
    334334            warnings.warn((error, msg)) 
     
    339339                cmd = self.next() 
    340340 
    341                 if Settings.swEcho: 
     341                if shcore.Settings.swEcho: 
    342342                    print cmd 
    343343 
     
    357357                # or execute command... 
    358358                elif cmd["shx_command"] in commands.list: 
    359                     if Settings.swVerify: 
     359                    if shcore.Settings.swVerify: 
    360360                        print cmd["shx_translated"] 
    361361 
     
    519519 
    520520    In order to test this class, we define a dummy command object. 
    521     >>> Settings.swVerify = True 
     521    >>> shcore.Settings.swVerify = True 
    522522    >>> cmd = { 
    523523    ...    'shx_command': 'echo', 
     
    587587 
    588588        # Actually this is only for debugging purposes. 
    589         if not Settings.swVerify: 
     589        if not shcore.Settings.swVerify: 
    590590            return 
    591591 
     
    748748 
    749749    def __init__(self): 
    750         self.__dict__["__globals"] = Settings.Globals 
     750        self.__dict__["__globals"] = shcore.Settings.Globals 
    751751 
    752752    def __getattr__(self, name): 
  • SHX/trunk/src/SeismicHandler/tests/test_parser.py

    r244 r246  
    5757        data = "\n".join(self.addEchoChannel(data.splitlines())) 
    5858 
    59         from SeismicHandler.core.parser import script, symbol 
    60  
    61         s = symbol() 
    62         x = script(StringIO(data), s) 
     59        from SeismicHandler.core import parser 
     60 
     61        s = parser.symbol() 
     62        x = parser.script(StringIO(data), s) 
    6363        x.run() 
    6464 
Note: See TracChangeset for help on using the changeset viewer.