Ejemplo n.º 1
0
 def connect(self):
     _fd = _orb._orbopen(self.orbname, self.permissions)
     if _fd < 0:
         raise OpenError()
     self._fd = _fd
     if self.select_str is not None:
         self.select(self.select_str)
     if self.reject_str is not None:
         self.reject(self.reject_str)
Ejemplo n.º 2
0
 def connect(self):
     _fd = _orb._orbopen(self.orbname, self.permissions)
     if _fd < 0:
         raise OpenError()
     self._fd = _fd
     if self.select_str is not None:
         self.select(self.select_str)
     if self.reject_str is not None:
         self.reject(self.reject_str)
Ejemplo n.º 3
0
    def __init__(self, *args, **kwargs):

        self._orbname = None
        self._orbfd = -1
        self._perm = 'r'

        if (kwargs.has_key('orbname')):

            self._orbname = kwargs['orbname']

        if (kwargs.has_key('perm')):

            self._perm = kwargs['perm']

        if (len(args) >= 1):

            if (isinstance(args[0], str)):

                self._orbname = args[0]

            else:

                stock.elog_complain('Orb constructor arguments not understood')

        if (len(args) >= 2):

            if (isinstance(args[1], str)):

                self._perm = args[1]

            else:

                stock.elog_complain('Orb constructor arguments not understood')

        if (self._orbname and not isinstance(self._orbname, str)):

            raise TypeError, 'dbname must be a string'

        if (not isinstance(self._perm, str)):

            raise TypeError, 'perm must be a string'

        if (self._orbname):

            try:

                self._orbfd = _orb._orbopen(self._orbname, self._perm)

            except _orb._ElogException, _e:

                stock._raise_elog(_e)

            if (self._orbfd < 0):

                stock.elog_complain('Failure opening orbserver "%s"' %
                                    self._orbname)
Ejemplo n.º 4
0
    def __init__(self, *args, **kwargs):

        self._orbname = None
        self._orbfd = -1
        self._perm = 'r'
    
        if(kwargs.has_key('orbname')):

            self._orbname = kwargs['orbname']

        if(kwargs.has_key('perm')):

            self._perm = kwargs['perm']

        if(len(args) >= 1):

            if(isinstance(args[0], str)):

                self._orbname = args[0]

            else:

                stock.elog_complain('Orb constructor arguments not understood')

        if(len(args) >= 2):

            if(isinstance(args[1], str)):

                self._perm = args[1]

            else:

                stock.elog_complain('Orb constructor arguments not understood')
        
        if(self._orbname and not isinstance(self._orbname, str)):
            
            raise TypeError, 'dbname must be a string'

        if(not isinstance(self._perm, str)):
            
            raise TypeError, 'perm must be a string'

        if(self._orbname):

	    try:

                self._orbfd = _orb._orbopen(self._orbname, self._perm)
            
	    except _orb._ElogException, _e: 

                stock._raise_elog(_e)

            if(self._orbfd < 0):

                stock.elog_complain('Failure opening orbserver "%s"' % self._orbname)
Ejemplo n.º 5
0
    def __init__(self, *args, **kwargs):

        self._orbname = None
        self._orbfd = -1
        self._perm = 'r'
    
        if(kwargs.has_key('orbname')):

            self._orbname = kwargs['orbname']

        if(kwargs.has_key('perm')):

            self._perm = kwargs['perm']

        if(len(args) >= 1):

            if(isinstance(args[0], str)):

                self._orbname = args[0]

            else:

                raise TypeError, 'Orb constructor arguments not understood'

        if(len(args) >= 2):

            if(isinstance(args[1], str)):

                self._perm = args[1]

            else:

                raise TypeError, 'Orb constructor arguments not understood'
        
        if(self._orbname and not isinstance(self._orbname, str)):
            
            raise TypeError, 'dbname must be a string'

        if(not isinstance(self._perm, str)):
            
            raise TypeError, 'perm must be a string'

        if(self._orbname):

            self._orbfd = _orb._orbopen(self._orbname, self._perm)

            if(self._orbfd < 0):

                raise RuntimeError, 'Failure opening orbserver %s' % self._orbname