示例#1
0
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
示例#2
0
 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
示例#4
0
 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
示例#5
0
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
示例#6
0
def generateUuid():
    return binascii.hexlify(uno.generateUuid().value).decode('utf-8')
示例#7
0
文件: test.py 项目: dm04806/systemn
	def getImplementationId (self):
		return uno.generateUuid ()
示例#8
0
文件: test.py 项目: hanya/pyuno3
 def test_generateUuid(self):
     v = uno.generateUuid()
     self.assertTrue(isinstance(v, uno.ByteSequence))
     self.assertEqual(len(v), 16)
     self.assertTrue(isinstance(v.value, bytes))
示例#9
0
 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?