(self)
Generate a new groupid (4-byte value that isn't 0 or 0xffffffff).
Generate a new groupid (4-byte value that isn't 0 or 0xffffffff).
Generate a new groupid ( 4 - byte value that isn t 0 or 0xffffffff ) .
def gen_groupid(self):
        """
        Generate a new groupid (4-byte value that isn't 0 or 0xffffffff).
        """
        existing_groupids = {group.groupid for group in self.groups}
        if len(existing_groupids) >= 0xfffffffe:
            raise Exception("All groupids are in use!")
        while True:
            groupid = random.randint(1, 0xfffffffe) # 0 and 0xffffffff are reserved
            if groupid not in existing_groupids:
                return groupid
def gen_groupid ( self ) : existing_groupids = { group . groupid for group in self . groups } if len ( existing_groupids ) >= 0xfffffffe : raise Exception ( "All groupids are in use!" ) while True : groupid = random . randint ( 1 , 0xfffffffe ) # 0 and 0xffffffff are reserved if groupid not in existing_groupids : return groupid