Beispiel #1
0
    def _init(self):
        Component._init(self)

        # connect to the database
        import pyre.db
        dbkwds = DbAddressResolver().resolve(self.inventory.db)
        self.db = pyre.db.connect(wrapper=self.inventory.dbwrapper, **dbkwds)
Beispiel #2
0
    def _init(self):
        Component._init(self)

        # connect to the database
        import pyre.db
        dbkwds = DbAddressResolver().resolve(self.inventory.db)
        self.db = pyre.db.connect(wrapper=self.inventory.dbwrapper, **dbkwds)
Beispiel #3
0
    def _init(self):
        base._init(self)

        # connect to the database
        import pyre.db
        dbkwds = DbAddressResolver().resolve(self.inventory.db)
        self.db = pyre.db.connect(wrapper=self.inventory.dbwrapper, **dbkwds)
        self.db.autocommit(True)  # ?
Beispiel #4
0
    def _init(self):
        Component._init(self)
        self.weaver = self.inventory.weaver

        renderer = self.getCurator().codecs['pml'].renderer
        self.weaver.renderer = renderer

        return
Beispiel #5
0
    def _init(self):
        Component._init(self)
        self.weaver = self.inventory.weaver

        renderer = self.getCurator().codecs['pml'].renderer
        self.weaver.renderer = renderer

        return
Beispiel #6
0
    def _init(self):
        base._init(self)

        # connect to the database
        import pyre.db
        dbkwds = DbAddressResolver().resolve(self.inventory.db)
        self.db = pyre.db.connect(wrapper=self.inventory.dbwrapper, **dbkwds)
        self.db.autocommit(True)    # ?
    def _init(self):
        Component._init(self)
        
        self._alphabet = list(self.inventory.alphabet)
        self._base = len(self._alphabet)
        self._hashtable = self._hash(self._alphabet)

        return
Beispiel #8
0
    def _init(self):
        import journal
        theJournal = journal.journal()

        device = self.inventory.device.device
        theJournal.device = device

        Component._init(self)

        return
Beispiel #9
0
    def _init(self):
        import journal
        theJournal = journal.journal()

        device = self.inventory.device.device
        theJournal.device = device

        Component._init(self)

        return
Beispiel #10
0
    def _init(self):
        Component._init(self)

        # locate the user database
        import os
        self.passwd = os.path.join(self.home, self.inventory.passwd)
        self._info.log("user database in '%s'" % self.passwd)

        # configure the weaver
        self.weaver = self.inventory.weaver
        self.weaver.language = "python"

        return
    def _init(self):
        Component._init(self)

        thickness = self.thickness
        width = self.width
        height = self.height
        darkAngle = self.darkAngle

        from sampleassembly.predefined.VanadiumPlate import VanadiumPlate
        
        self._sample = VanadiumPlate(  self.name, width, height, thickness, darkAngle )
        
        return
Beispiel #12
0
    def _init(self):
        Component._init(self)

        # locate the user database
        import os
        self.passwd = os.path.join(self.home, self.inventory.passwd)
        self._info.log("user database in '%s'" % self.passwd)

        # configure the weaver
        self.weaver = self.inventory.weaver
        self.weaver.language = "python"

        return
    def _init(self):
        Component._init(self)

        thickness = self.thickness
        width = self.width
        height = self.height
        darkAngle = self.darkAngle

        from sampleassembly.predefined.VanadiumPlate import VanadiumPlate

        self._sample = VanadiumPlate(self.name, width, height, thickness,
                                     darkAngle)

        return
 def _init(self):
     """ 
         Initialization of the underlying model 
     """
     Component._init(self)
     
     # Set the parameters of the underlying model
     for name in model.params: 
         if hasattr(self, name):
             self.set(name, getattr(self, name))
         else:
             raise ValueError, "%s not an attribute" % name
     
     return
Beispiel #15
0
    def _init(self):
        base._init(self)

        from dsaw.dds import dds, filemirror, node
        masternode = node(address='localhost', rootpath=self.dataroot)

        ddscomponent = self
        def readfile(url):
            computingNode, path = _decodeurl(url)
            if _islocal(computingNode):
                return open(path).read()
            import tempfile
            d = tempfile.mkdtemp()
            ddscomponent.remoteaccess.getfile(computingNode, path, d)
            filename = os.path.split(path)[1]
            ret = open(os.path.join(d, filename)).read()
            shutil.rmtree(d)
            return ret
            
        def writefile(url, content):
            computingNode, path = _decodeurl(url)
            if _islocal(computingNode):
                return open(path, 'w').write(content)
            import tempfile
            f = tempfile.mktemp()
            open(f, 'w').write(content)
            ddscomponent.remoteaccess.copyfile(localhost, f, computingNode, path)
            os.remove(f)
            return

        def makedirs(url):
            computingNode, path = _decodeurl(url)
            if _islocal(computingNode):
                if os.path.exists(path): return
                return os.makedirs(path)
            cmd = 'mkdir -p %s' % path
            ddscomponent.remoteaccess.execute(cmd, computingNode, '')
            return

        def rename(path1, path2, surl):
            computingNode = _decodesurl(surl)
            if _islocal(computingNode):
                try:
                    return os.rename(path1, path2)
                except Exception, e:
                    msg = 'Unable to rename path %r to %r: %s' % (path1, path2, e)
                    raise RuntimeError, msg
            cmd = 'mv %s %s' % (path1, path2)
            ddscomponent.remoteaccess.execute(cmd, computingNode, '')
            return
Beispiel #16
0
        def _init(self):
            """ 
                Initialization of the underlying model 
            """
            Component._init(self)

            # Set the parameters of the underlying model
            for name in model.params:
                if hasattr(self, name):
                    self.set(name, getattr(self, name))
                else:
                    raise ValueError, "%s not an attribute" % name

            return
Beispiel #17
0
    def _init(self):
        Component._init(self)

        import sys
        if len(self.logfile) == 0:
            logstream = sys.stdout
        else:
            logstream = open( self.logfile, 'w' )
        self.logstream = logstream

        if self.errlogfile == self.logfile:
            if len (self.errlogfile) == 0:
                errlogstream = sys.stderr
            else:
                errlogstream = self.logstream
        else:
            errlogstream = open(self.errlogfile, 'w')
        self.errlogstream = errlogstream
        
        return
Beispiel #18
0
    def _init(self):
        Component._init(self)

        # install the ipc support
        import pyre.ipc
        self.selector = self._createSelector()
        self.monitor = self._createPortMonitor()

        # create the command dispatcher
        self.evaluator = self._createEvaluator()

        # initialize the port monitor
        self.monitor.install(self.inventory.port)

        # register our callbacks
        self.selector.notifyWhenIdle(self.onTimeout)
        self.selector.notifyOnInterrupt(self.onInterrupt)
        self.selector.notifyOnReadReady(self.monitor, self.onConnectionAttempt)

        # register the signal handlers
        self.registerSignalHandlers()

        return
Beispiel #19
0
    def _init(self):
        Component._init(self)

        # install the ipc support
        import pyre.ipc
        self.selector = self._createSelector()
        self.monitor = self._createPortMonitor()

        # create the command dispatcher
        self.evaluator = self._createEvaluator()

        # initialize the port monitor
        self.monitor.install(self.inventory.port)

        # register our callbacks
        self.selector.notifyWhenIdle(self.onTimeout)
        self.selector.notifyOnInterrupt(self.onInterrupt)
        self.selector.notifyOnReadReady(self.monitor, self.onConnectionAttempt)

	# register the signal handlers
        self.registerSignalHandlers()

        return
Beispiel #20
0
 def _init(self):
     Component._init(self)
     self.initialize()
     return
Beispiel #21
0
 def _init(self):
     Component._init(self)
     self.deepcopy = DeepCopier(self)
     return
Beispiel #22
0
 def _init(self):
     Component._init(self)
     if self.inventory.dump: self._dump()
     return
Beispiel #23
0
 def _init(self):
     base._init(self)
     self.submit = self.inventory.submit 
     return
Beispiel #24
0
 def _init(self):
     Component._init(self)
     self.deepcopy = DeepCopier( self )
     return
 def _init(self):
     Component._init(self)
     return
Beispiel #26
0
 def _init(self):
     Component._init(self)
     self.initialize()
     return
Beispiel #27
0
 def _init(self):
     Component._init(self)
     from histogram.plotter import HistogramMplPlotter as P
     self._engine = P()
     return
Beispiel #28
0
 def _init(self):
     Component._init(self)
     return
 def _init(self):
     base._init(self)
 def _init(self):
     base._init(self)
Beispiel #31
0
 def _init(self):
     base._init(self)
     return
Beispiel #32
0
 def _init(self):
     Component._init(self)
     if self.inventory.dump: self._dump()
     return