MCPcopy Create free account
hub / github.com/dtmilano/AndroidViewClient / __mapSerialNo

Method __mapSerialNo

src/com/dtmilano/android/viewclient.py:2775–2800  ·  view source on GitHub ↗
(serialno)

Source from the content-addressed store, hash-verified

2773
2774 @staticmethod
2775 def __mapSerialNo(serialno):
2776 serialno = serialno.strip()
2777 if IP_RE.match(serialno):
2778 if DEBUG_DEVICE: print("ViewClient: adding default port to serialno", serialno, ADB_DEFAULT_PORT,
2779 file=sys.stderr)
2780 return serialno + ':%d' % ADB_DEFAULT_PORT
2781
2782 ipPortRE = re.compile(IP_DOMAIN_NAME_PORT_REGEX, re.IGNORECASE)
2783
2784 if ipPortRE.match(serialno):
2785 # nothing to map
2786 return serialno
2787
2788 if IPV6_RE.match(serialno):
2789 if DEBUG_DEVICE: print("ViewClient: adding default port to serialno", serialno, ADB_DEFAULT_PORT,
2790 file=sys.stderr)
2791 return '[' + serialno + ']:%d' % ADB_DEFAULT_PORT
2792
2793 if IPV6_PORT_RE.match(serialno):
2794 # nothing to map
2795 return serialno
2796
2797 if re.search("[.*()+]", serialno):
2798 raise ValueError("Regular expression not supported as serialno in ViewClient. Found '%s'" % serialno)
2799
2800 return serialno
2801
2802 @staticmethod
2803 def __obtainDeviceSerialNumber(device):

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected