Пример #1
0
 def createDomain(host, port, entity_root):
     d = HpiDomain(SAHPI_UNSPECIFIED_DOMAIN_ID, host, port, entity_root)
     HpiCore.lock.acquire()
     did = 0
     while HpiCore.domains.has_key(did):
         did = did + 1
     d.setLocalDid(did)
     HpiCore.domains[did] = d
     HpiCore.lock.release()
     return d
Пример #2
0
 def createDomain( host, port, entity_root ):
     d = HpiDomain( SAHPI_UNSPECIFIED_DOMAIN_ID, host, port, entity_root )
     HpiCore.lock.acquire()
     did = 0
     while HpiCore.domains.has_key( did ):
         did = did + 1
     d.setLocalDid( did )
     HpiCore.domains[did] = d
     HpiCore.lock.release()
     return d
Пример #3
0
 def createDefaultDomain():
     if HpiCore.domains.has_key( SAHPI_UNSPECIFIED_DOMAIN_ID ):
         return
     host = os.environ.get( "OPENHPI_DAEMON_HOST", "localhost" )
     portstr = os.environ.get( "OPENHPI_DAEMON_PORT", str( DEFAULT_PORT ) )
     try:
         port = int( portstr )
     except ValueError:
         port = DEFAULT_PORT
     root = HpiUtil.makeRootSaHpiEntityPathT()
     d = HpiDomain( SAHPI_UNSPECIFIED_DOMAIN_ID, host, port, root )
     HpiCore.domains[d.getLocalDid()] = d
Пример #4
0
 def createDefaultDomain():
     if HpiCore.domains.has_key(SAHPI_UNSPECIFIED_DOMAIN_ID):
         return
     host = os.environ.get("OPENHPI_DAEMON_HOST", "localhost")
     portstr = os.environ.get("OPENHPI_DAEMON_PORT", str(DEFAULT_PORT))
     try:
         port = int(portstr)
     except ValueError:
         port = DEFAULT_PORT
     root = HpiUtil.makeRootSaHpiEntityPathT()
     d = HpiDomain(SAHPI_UNSPECIFIED_DOMAIN_ID, host, port, root)
     HpiCore.domains[d.getLocalDid()] = d
Пример #5
0
 def createDomainById(did, host, port, entity_root, overwrite):
     d = None
     HpiCore.lock.acquire()
     if (not HpiCore.domains.has_key(did)) or overwrite:
         d = HpiDomain(did, host, port, entity_root)
         HpiCore.domains[did] = d
     HpiCore.lock.release()
     return d
Пример #6
0
 def __init__(self, domain):
     HpiSession.next_local_sid_lock.acquire()
     self.local_sid = HpiSession.next_local_sid
     HpiSession.next_local_sid += 1
     HpiSession.next_local_sid_lock.release()
     self.remote_sid = None
     self.domain = HpiDomain.clone(domain)
     self.marshals = collections.deque()
     self.marshals_lock = threading.RLock()
Пример #7
0
 def __init__( self, domain ):
     HpiSession.next_local_sid_lock.acquire()
     self.local_sid  = HpiSession.next_local_sid
     HpiSession.next_local_sid += 1
     HpiSession.next_local_sid_lock.release()
     self.remote_sid = None
     self.domain = HpiDomain.clone( domain )
     self.marshals = collections.deque()
     self.marshals_lock = threading.RLock()