def create_child_id(self, cm_event=None): if not self.passive: raise PyverbsUserError( 'create_child_id can be used only in passive side') new_child_idx = len(self.child_ids) self.child_ids[new_child_idx] = CMID(creator=cm_event, listen_id=self.cmid)
def create_child_id(self, cm_event=None): if not self.is_server: raise PyverbsUserError( 'create_child_id can be used only in passive side') if self.is_async: self.child_id = CMID(creator=cm_event, listen_id=self.cmid) else: self.child_id = self.cmid.get_request()
def gid_str_to_array(val): """ Splits a GID to an array of u8 that can be easily assigned to a GID's raw array. :param val: GID value in 8 words format 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx' :return: An array of format xx:xx etc. """ val = val.split(':') if len(val) != 8: raise PyverbsUserError('Invalid GID value ({val})'.format(val=val)) if any([len(v) != 4 for v in val]): raise PyverbsUserError('Invalid GID value ({val})'.format(val=val)) val_int = int(''.join(val), 16) vals = [] for i in range(8): vals.append(val[i][0:2]) vals.append(val[i][2:4]) return vals
def create_child_id(self, cm_event=None): if not self.passive: raise PyverbsUserError('create_child_id can be used only in passive side') new_child_idx = len(self.child_ids) self.child_ids[new_child_idx] = self.cmid.get_request()