def _unohelper_getHandle(self): ret = None if _g_typeTable.has_key(self.__class__): ret = _g_typeTable[self.__class__] else: names = {} traverse = list(self.__class__.__bases__) while len(traverse) > 0: item = traverse.pop() bases = item.__bases__ if uno.isInterface(item): names[item.__pyunointerface__] = None elif len(bases) > 0: # the "else if", because we only need the most derived interface traverse = traverse + list(bases) # lst = names.keys() types = [] for x in lst: t = uno.getTypeByName(x) types.append(t) ret = tuple(types), uno.generateUuid() _g_typeTable[self.__class__] = ret return ret
def _getNewIdentifier(self): if self.User.Provider.GenerateIds: identifier = self.User.DataBase.getNewIdentifier(self.User.Id) else: identifier = binascii.hexlify( uno.generateUuid().value).decode('utf-8') return identifier
def _unohelper_getHandle( self): ret = None if self.__class__ in _g_typeTable: ret = _g_typeTable[self.__class__] else: names = {} traverse = list(self.__class__.__bases__) while len( traverse ) > 0: item = traverse.pop() bases = item.__bases__ if uno.isInterface( item ): names[item.__pyunointerface__] = None elif len(bases) > 0: # the "else if", because we only need the most derived interface traverse = traverse + list(bases)# lst = list(names.keys()) types = [] for x in lst: t = uno.getTypeByName( x ) types.append( t ) ret = tuple(types) , uno.generateUuid() _g_typeTable[self.__class__] = ret return ret
def getNewIdentifier(self, user): if self.Provider.GenerateIds: id = '' select = self._getDataSourceCall('getNewIdentifier') select.setString(1, user.getValue('UserId')) result = select.executeQuery() if result.next(): id = result.getString(1) select.close() else: id = binascii.hexlify(uno.generateUuid().value).decode('utf-8') return id
def _unohelper_getHandle( self): ret = None if self.__class__ in _g_typeTable: ret = _g_typeTable[self.__class__] else: names = set() traverse = list(self.__class__.__bases__) while len( traverse ) > 0: item = traverse.pop() bases = item.__bases__ if uno.isInterface( item ): names.add(item.__pyunointerface__) elif bases: # the "else if", because we only need the most derived interface traverse = traverse + list(bases)# types = [uno.getTypeByName(name) for name in names] ret = tuple(types) , uno.generateUuid() _g_typeTable[self.__class__] = ret return ret
def generateUuid(): return binascii.hexlify(uno.generateUuid().value).decode('utf-8')
def getImplementationId (self): return uno.generateUuid ()
def test_generateUuid(self): v = uno.generateUuid() self.assertTrue(isinstance(v, uno.ByteSequence)) self.assertEqual(len(v), 16) self.assertTrue(isinstance(v.value, bytes))
def __init__(self, uuid=uno.generateUuid()): self.uuid = uuid self.name = "name-not-set" self.check_var = tkinter.IntVar() # TODO: Change to not rely on tkinter?