""" global variables used by multiple modules """ class MyPeer: """ My peer """ My_peer = {} def __init__(self): pass ###################################################### # DictList is a queue, which is implemented as a list. # each record is implemented as a dictionary. Each # attribute in record is implemented as key in # the dictionary: # Example: # [{'attrib1':,attrib1,'attrib2':attrib2...},...] ###################################################### class DictList(list): """ List of Dictionaries """ def __init__(self): pass class PeerList(DictList): """ List of Peers, e.g. Host Cache """ # Peer_list = [{'sim_rank':sim, 'peer_id': id, 'port':ownport, 'ip':ipaddress, 'time':lastseetime, 'play_list':'null'}] Peer_list = [] # Do not include myself def __init__(self): pass def readPeerList(): pass readPeerList = staticmethod(readPeerList) class MyTorrentList(DictList): """ My torrent file list """ # [{'torrent_id', 'torrent_name', 'description', 'time'}] My_torrent_list = [] def __init__(self): pass class TorrentList(DictList): """ List of torrent files, including my and my friends' torrents, e.g. File cache """ # [{'torrent_id', 'torrent_name', 'description', 'time'}] Torrent_list = [] # Do not include my torrent files def __init__(self): pass class PreferenceList(DictList): """ Preference """ # [{'peer_id':peer_id, 'torrent_id':torrent_id, 'rating':rating, 'time':time}] Preference_List = [] def __init__(self): pass