Changeset 3509
- Timestamp:
- 08/17/08 18:14:47 (5 years ago)
- Location:
- branch/PacketManipulator/PM
- Files:
-
- 4 modified
-
Backend/Scapy/wrapper.py (modified) (1 diff)
-
Core/Const.py (modified) (2 diffs)
-
Manager/PreferenceManager.py (modified) (4 diffs)
-
PacketManipulator (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branch/PacketManipulator/PM/Backend/Scapy/wrapper.py
r3507 r3509 92 92 93 93 def get_proto_layer(proto): 94 return None94 return getattr(proto, '_pm_layer', None) 95 95 96 96 def get_proto_fields(proto_inst): -
branch/PacketManipulator/PM/Core/Const.py
r3498 r3509 35 35 HOME = os.path.expanduser("~") 36 36 CURRENT_DIR = os.getcwd() 37 PM_HOME = os.path.join(HOME, '.PacketManipulator') 37 38 38 39 main_dir = os.path.abspath(os.path.dirname(sys.argv[0])) … … 46 47 LOCALE_DIR = os.path.join(main_dir, "share", "locale") 47 48 PIXMAPS_DIR = os.path.join(main_dir, "share", "pixmaps", "umit") 49 50 if os.path.exists(HOME) and \ 51 os.access(HOME, os.R_OK and os.W_OK) and \ 52 not os.path.exists(PM_HOME): 53 os.mkdir(PM_HOME) 54 else: 55 print "No permission to create %s" % PM_HOME -
branch/PacketManipulator/PM/Manager/PreferenceManager.py
r3499 r3509 25 25 26 26 import sys 27 import os.path 27 28 28 29 from xml.sax import handler, make_parser … … 30 31 from xml.sax.xmlreader import AttributesNSImpl 31 32 33 from PM.Core.Const import PM_HOME 32 34 from PM.Core.Atoms import Singleton 33 35 … … 180 182 181 183 def __init__(self): 182 self.fname = 'pm-prefs.xml'184 self.fname = os.path.join(PM_HOME, 'pm-prefs.xml') 183 185 184 186 try: … … 208 210 def __getitem__(self, x): 209 211 return self.options[x] 210 211 if __name__ == "__main__":212 Prefs().load_options('test.xml')213 -
branch/PacketManipulator/PM/PacketManipulator
r3500 r3509 24 24 25 25 try: 26 if os.getenv('PM_ DEVELOPMENT', False):26 if os.getenv('PM_NOPSYCO', False): 27 27 raise ImportError 28 28
