コード例 #1
0
 def _outputType(self, type, limit=None):
     if type not in self._type2id2len:
         return
     len2ids = invertDictLossless(self._type2id2len[type])
     lengths = len2ids.keys()
     lengths.sort()
     lengths.reverse()
     print '====='
     print '===== %s' % type
     count = 0
     stop = False
     for l in lengths:
         #len2ids[l].sort()
         pathStrList = list()
         for id in len2ids[l]:
             obj = self._id2container[id]
             #print '%s: %s' % (l, self._id2pathStr[id])
             pathStrList.append(self._id2pathStr[id])
             count += 1
             if (count & 0x7f) == 0:
                 yield None
         pathStrList.sort()
         for pathstr in pathStrList:
             print '%s: %s' % (l, pathstr)
         if limit is not None and count >= limit:
             return
コード例 #2
0
ファイル: ObjectPool.py プロジェクト: kralf/panda3d
 def __init__(self, objects):
     self._objs = list(objects)
     self._type2objs = {}
     self._count2types = {}
     self._len2obj = {}
     type2count = {}
     for obj in self._objs:
         typ = itype(obj)
         type2count.setdefault(typ, 0)
         type2count[typ] += 1
         self._type2objs.setdefault(typ, [])
         self._type2objs[typ].append(obj)
         try:
             self._len2obj[len(obj)] = obj
         except:
             pass
     self._count2types = invertDictLossless(type2count)
コード例 #3
0
ファイル: ObjectPool.py プロジェクト: kralf/panda3d
 def __init__(self, objects):
     self._objs = list(objects)
     self._type2objs = {}
     self._count2types = {}
     self._len2obj = {}
     type2count = {}
     for obj in self._objs:
         typ = itype(obj)
         type2count.setdefault(typ, 0)
         type2count[typ] += 1
         self._type2objs.setdefault(typ, [])
         self._type2objs[typ].append(obj)
         try:
             self._len2obj[len(obj)] = obj
         except:
             pass
     self._count2types = invertDictLossless(type2count)
コード例 #4
0
ファイル: MsgTypes.py プロジェクト: kralf/panda3d
    'CLIENT_REMOVE_INTEREST':                        99,
    'CLIENT_OBJECT_LOCATION':                        102,

    'CLIENT_LOGIN_3':                                111,
    'CLIENT_LOGIN_3_RESP':                           110,

    'CLIENT_GET_FRIEND_LIST_EXTENDED':               115,
    'CLIENT_GET_FRIEND_LIST_EXTENDED_RESP':          116,

    'CLIENT_SET_FIELD_SENDABLE':                     120,
    
    'CLIENT_SYSTEMMESSAGE_AKNOWLEDGE':               123,
    }

# create id->name table for debugging
MsgId2Names = invertDictLossless(MsgName2Id)
    
# put msg names in module scope, assigned to msg value
for name, value in MsgName2Id.items():
    exec '%s = %s' % (name, value)
del name, value

# These messages are ignored when the client is headed to the quiet zone
QUIET_ZONE_IGNORED_LIST = [

    # We mustn't ignore updates, because some updates for localToon
    # are always important.
    #CLIENT_OBJECT_UPDATE_FIELD,
    
    # These are now handled. If it is a create for a class that is in the
    # uber zone, we should create it.
コード例 #5
0
    'CLIENT_SET_AVTYPE': 80,
    'CLIENT_GET_PET_DETAILS': 81,
    'CLIENT_GET_PET_DETAILS_RESP': 82,
    'CLIENT_ADD_INTEREST': 97,
    'CLIENT_REMOVE_INTEREST': 99,
    'CLIENT_OBJECT_LOCATION': 102,
    'CLIENT_LOGIN_3': 111,
    'CLIENT_LOGIN_3_RESP': 110,
    'CLIENT_GET_FRIEND_LIST_EXTENDED': 115,
    'CLIENT_GET_FRIEND_LIST_EXTENDED_RESP': 116,
    'CLIENT_SET_FIELD_SENDABLE': 120,
    'CLIENT_SYSTEMMESSAGE_AKNOWLEDGE': 123,
}

# create id->name table for debugging
MsgId2Names = invertDictLossless(MsgName2Id)

# put msg names in module scope, assigned to msg value
for name, value in MsgName2Id.items():
    exec '%s = %s' % (name, value)
del name, value

# These messages are ignored when the client is headed to the quiet zone
QUIET_ZONE_IGNORED_LIST = [

    # We mustn't ignore updates, because some updates for localToon
    # are always important.
    #CLIENT_OBJECT_UPDATE_FIELD,

    # These are now handled. If it is a create for a class that is in the
    # uber zone, we should create it.