Changeset 221


Ignore:
Timestamp:
07/13/2010 03:16:03 PM (12 years ago)
Author:
marcus
Message:
  • Some clean-up for simpler structure.
  • Added shared library in 32-bit version.
Location:
SHX/trunk/src/SeismicHandler
Files:
4 added
4 edited
2 copied

Legend:

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

    r217 r221  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.base.command import BaseCommand 
     18from SeismicHandler.core.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
     
    6565    >>> newout = StringIO() 
    6666    >>> oldout, Settings.echo_channel = Settings.echo_channel, newout 
    67     >>> _ = echo("foo", "bar", NO_CRLF=True) # no line feed 
     67    >>> _ = echo("foo", "bar", NO_CRLF=True) 
    6868    >>> newout.getvalue() 
    6969    'foo bar' 
    7070    >>> _ = echo("qux") 
    71     >>> newout.getvalue()[:-1] # skip the line break 
    72     'foo bar qux' 
     71    >>> newout.getvalue() 
     72    'foo bar qux\\n' 
    7373    >>> Settings.echo_channel = oldout   # restore output channel 
    7474    """ 
  • SHX/trunk/src/SeismicHandler/commands/echo_ch.py

    r194 r221  
    1616#    along with SHX.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 from SeismicHandler.core.base.command import BaseCommand 
     18from SeismicHandler.core.command import BaseCommand 
    1919from SeismicHandler.core import Settings 
    2020 
     
    8787    echo_ch("test2") 
    8888#    echo_ch() 
    89     from SeismicHandler.core.base.parser import parse 
     89    from SeismicHandler.core.parser import parse 
    9090    echo_ch(**(parse("echo_ch test2/new").parsed)) 
  • SHX/trunk/src/SeismicHandler/core/__init__.py

    r194 r221  
    2323from SeismicHandler.core import codes 
    2424 
    25 from SeismicHandler.core.runtime import Settings, Globals 
     25from SeismicHandler.core.runtime import runtime 
     26 
     27Settings = runtime() 
     28Globals = Settings.Globals 
  • SHX/trunk/src/SeismicHandler/core/parser.py

    r219 r221  
    3030import re 
    3131import inspect 
    32 from SeismicHandler.core.setting import Settings 
     32from SeismicHandler.core import Settings 
    3333 
    3434class parse(object): 
  • SHX/trunk/src/SeismicHandler/core/runtime.py

    r210 r221  
    2323 
    2424import sys 
    25 from SeismicHandler.core.base import Property 
     25from SeismicHandler.core.tools import Property 
    2626 
    2727class runtime(object): 
     
    3737    def __new__(cls): 
    3838        """ 
    39         Ensure that there's only one instance of the settings class. 
     39        Ensure that there's only one instance of the settings class. This 
     40        enables us to set global configuration options and carry global 
     41        variables. 
     42 
     43        Technically this is a singleton. 
    4044        """ 
    4145 
     
    5963        "__echo_channel". 
    6064        """ 
    61         doc = "echo_channel: standard output for echo command" 
    6265 
    6366        def fget(self): 
     
    7073                return 
    7174 
    72             # we assume that there's a file for output or a stream 
     75            # We assume that there's a file for output or a stream (actually I 
     76            # don't really care about it's true nature, since it offers the 
     77            # methods "write" and "close"). 
    7378            if hasattr(value, "write") and hasattr(value, "close"): 
    7479                self.__echo_channel = value 
     
    9196        return locals() 
    9297 
    93 Settings = runtime() 
    94 Globals = Settings.Globals 
    95  
    9698if __name__ == "__main__": 
    9799    print >> Settings.echo_channel, Settings.echo_channel 
Note: See TracChangeset for help on using the changeset viewer.