コード例 #1
0
ファイル: launch.py プロジェクト: timtroendle/sumatra
 def get_platform_information(self):
     """
     Return a list of `PlatformInformation` objects, containing information
     about the machine(s) and environment(s) the computations are being
     performed on/in.
     """
     network_name = platform.node()
     bits, linkage = platform.architecture()
     if have_internet_connection():
         try:
             ip_addr = socket.gethostbyname(
                 network_name)  # any way to control the timeout?
         except socket.gaierror:  # see http://stackoverflow.com/questions/166506/finding-local-ip-addresses-in-python
             ip_addr = "127.0.0.1"
     else:
         ip_addr = "127.0.0.1"
     return [
         PlatformInformation(architecture_bits=bits,
                             architecture_linkage=linkage,
                             machine=platform.machine(),
                             network_name=network_name,
                             ip_addr=ip_addr,
                             processor=platform.processor(),
                             release=platform.release(),
                             system_name=platform.system(),
                             version=platform.version())
     ]
コード例 #2
0
ファイル: _subversion.py プロジェクト: scottc99/sumatra
 def exists(self):
     if urlparse(self.url).scheme == 'file' or have_internet_connection():
         # check that there is a valid Subversion repository at the URL,
         # without doing a checkout.
         try:
             self._client.ls(self.url)
         except pysvn._pysvn.ClientError:
             return False
     return True
コード例 #3
0
 def exists(self):
     if urlparse(self.url).scheme == 'file' or have_internet_connection():
         # check that there is a valid Subversion repository at the URL,
         # without doing a checkout.
         try:
             self._client.ls(self.url)
         except pysvn._pysvn.ClientError:
             return False
     return True
コード例 #4
0
ファイル: launch.py プロジェクト: scottc99/sumatra
 def get_platform_information(self):
     """
     Return a list of `PlatformInformation` objects, containing information
     about the machine(s) and environment(s) the computations are being
     performed on/in.
     """
     network_name = platform.node()
     bits, linkage = platform.architecture()
     if have_internet_connection():
         try:
             ip_addr = socket.gethostbyname(network_name)  # any way to control the timeout?
         except socket.gaierror:  # see http://stackoverflow.com/questions/166506/finding-local-ip-addresses-in-python
             ip_addr = "127.0.0.1"
     else:
         ip_addr = "127.0.0.1"
     return [PlatformInformation(architecture_bits=bits,
                                 architecture_linkage=linkage,
                                 machine=platform.machine(),
                                 network_name=network_name,
                                 ip_addr=ip_addr,
                                 processor=platform.processor(),
                                 release=platform.release(),
                                 system_name=platform.system(),
                                 version=platform.version())]