当前位置: 首页>>代码示例>>Python>>正文


Python Transport.__init__方法代码示例

本文整理汇总了Python中transport.Transport.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Transport.__init__方法的具体用法?Python Transport.__init__怎么用?Python Transport.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在transport.Transport的用法示例。


在下文中一共展示了Transport.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
    def __init__(self, jobname, compute_nodes, replicas): #changed on 12/1/14
        # jobname: identifies current asyncRE job
        # compute_nodes: list of names of nodes in the pool
        # nreplicas: number of replicas, 0 ... nreplicas-1
        Transport.__init__(self) #WFF - 2/18/15
        self.logger = logging.getLogger("async_re.ssh_transport") #WFF - 3/2/15

        # names of compute nodes (slots)
        self.compute_nodes = compute_nodes #changed on 12/1/14
        self.nprocs = len(self.compute_nodes)
        #self.openmm_platform = None
                        
        # node status = None if idle
        # Otherwise a structure containing:
        #    replica number being executed
        #    process id
        #    process name
        #    ...
        self.node_status = [ None for k in range(self.nprocs)]
	#self.openmm_platform = None
	

        # contains the nodeid of the node running a replica
        # None = no information about where the replica is running
        self.replica_to_job = [ None for k in replicas ]

        # implements a queue of jobs from which to draw the next job
        # to launch
        self.jobqueue = Queue.Queue()
开发者ID:baofzhang,项目名称:async_re-openmm,代码行数:31,代码来源:ssh_transport.py

示例2: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
    def __init__(self, **kwargs):
        """

        :param host:
        :param port:
        :param timeout:
        :param connect:
        :return:
        """
        port = get_kwarg('port', kwargs, 7147)
        timeout = get_kwarg('timeout', kwargs, 10)
        Transport.__init__(self, **kwargs)

        # Create instance of self.logger
        try:
            self.logger = kwargs['logger']
        except KeyError:
            self.logger = logging.getLogger(__name__)

        new_connection_msg = '*** NEW CONNECTION MADE TO {} ***'.format(self.host)
        self.logger.info(new_connection_msg)

        katcp.CallbackClient.__init__(
            self, self.host, port, tb_limit=20,
            timeout=timeout, logger=self.logger, auto_reconnect=True)
        self.system_info = {}
        self.unhandled_inform_handler = None
        self._timeout = timeout
        self.connect()
        self.logger.info('%s: port(%s) created and connected.' % (self.host, port))
开发者ID:ska-sa,项目名称:casperfpga,代码行数:32,代码来源:transport_katcp.py

示例3: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
 def __init__(self, debug=False, verbose=False):
     self.client.login()
     if verbose:
         self.log.basicConfig(level=self.log.INFO)
     if debug:
         self.log.basicConfig(level=self.log.DEBUG)
     Transport.__init__(self, self.client, self.log)
     NetworkServices.__init__(self, self.client, self.log)
     ControlServices.__init__(self, self.client, self.log)
开发者ID:thecantero,项目名称:nvpnsxapi,代码行数:11,代码来源:nvp_api.py

示例4: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
    def __init__(self, jobname, keywords, nreplicas, files_to_stage):
        # jobname: identifies current asyncRE job
        # files_to_stage: permanent files to stage into BOINC download directory (main struct file, datafiles, etc.)
        Transport.__init__(self)
        self.logger = logging.getLogger("async_re.boinc_transport")

        self.jobname = jobname

        # variables required for boinc-based transport
        if keywords.get('BOINC_PROJECTDIR') is None:
            self._exit("BOINC transport requires a BOINC_PROJECTDIR")
        self.project_dir = keywords.get('BOINC_PROJECTDIR')
        if not os.path.isdir(self.project_dir):
            self.logger.critical("Unable to located BOINC project directory: %s",
                                 self.project_dir)
            sys.exit(1)

        #sets up a mapping between replicas running and work unit ids
        self.replica_to_wuid = [ None for k in range(nreplicas)]

        #sets up lookup table for replica done status
        self.replica_status = dict()

        #set connection with mysql boinc server database
        if keywords.get('BOINC_DATABASE') is None:
            self.logger.critical("BOINC transport requires a BOINC_DATABASE")
            sys.exit(1)
        if keywords.get('BOINC_DATABASE_USER') is None:
            self.logger.critical("BOINC transport requires a BOINC_DATABASE_USER")
            sys.exit(1)
        if keywords.get('BOINC_DATABASE_PASSWORD') is None:
            self.logger.critical("BOINC transport requires a BOINC_DATABASE_PASSWORD")
            sys.exit(1)
        self.db_name = keywords.get('BOINC_DATABASE')
        self.db_user = keywords.get('BOINC_DATABASE_USER')
        self.db_pwd = keywords.get('BOINC_DATABASE_PASSWORD')

        # stage files
        if files_to_stage is not None:
            for file in files_to_stage:
                filepath = os.getcwd() + "/" + file
                self._stage_file(filepath,file)
开发者ID:baofzhang,项目名称:async_re-openmm,代码行数:44,代码来源:boinc_transport.py

示例5: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
    def __init__(self, **kwargs):
        """
        Initialized Tapcp FPGA object
        :param host: IP Address of the targeted Board
        :return: none
        """
        try:
            import tftpy
            global TFTPY
            TFTPY = tftpy
        except ImportError:
            raise ImportError('You need to install tftpy to use TapcpTransport')
        Transport.__init__(self, **kwargs)
        set_log_level(logging.ERROR)
        self.t = tftpy.TftpClient(kwargs['host'], 69)
        try:
            self.logger = kwargs['logger']
        except KeyError:
            self.logger = logging.getLogger(__name__)

        new_connection_msg = '*** NEW CONNECTION MADE TO {} ***'.format(self.host)
        self.logger.info(new_connection_msg)
        self.timeout = kwargs.get('timeout', 3)
开发者ID:ska-sa,项目名称:casperfpga,代码行数:25,代码来源:transport_tapcp.py

示例6: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
 def __init__(self, mode, applications, own_ip):
   Transport.__init__(self, mode, applications, own_ip)
   self.connection = Connection
   self.name = 'UDP'
   self.socktype = SOCK_DGRAM
   self.server = Udpserver
开发者ID:siemens,项目名称:sparring,代码行数:8,代码来源:udp.py

示例7: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
 def __init__(self, auto_gen=False):
     Transport.__init__(self)
     self.comm = MCUComm()
     self.wrote = ""
     self.ans_buff = ""
     self.auto_gen = auto_gen
开发者ID:cristianReynaga,项目名称:pivi-pyvi,代码行数:8,代码来源:test_transport.py

示例8: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
 def __init__(self):
     Transport.__init__(self)
     self.sock = None
     self.srv_addr = None
开发者ID:cristianReynaga,项目名称:pivi-pyvi,代码行数:6,代码来源:udp_transport.py

示例9: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
 def __init__(self, mode, applications, own_ip):
   Transport.__init__(self, mode, applications, own_ip)
   self.connection = Tcpconnection
   self.name = 'TCP'
   self.socktype = SOCK_STREAM
   self.server = Tcpserver
开发者ID:siemens,项目名称:sparring,代码行数:8,代码来源:tcp.py

示例10: __init__

# 需要导入模块: from transport import Transport [as 别名]
# 或者: from transport.Transport import __init__ [as 别名]
 def __init__(self):
     Transport.__init__(self)
     self.port = None
     self.baudrate = None
开发者ID:cristianReynaga,项目名称:pivi-pyvi,代码行数:6,代码来源:serial_transport.py


注:本文中的transport.Transport.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。