Beispiel #1
0
 def pack_begin(self, in_path):
   # remove trailing slash
   if in_path[-1] == '/':
     in_path = in_path[:-1]
   meta_path = in_path + ".xdfmeta"
   if os.path.exists(meta_path):
     self.meta_db = MetaDB()
     self.meta_db.load(meta_path)
Beispiel #2
0
 def unpack(self, volume, out_path):
   # check for volume path
   vol_name = volume.name.get_unicode()
   if not os.path.exists(out_path):
     vol_path = out_path
   else:
     path = os.path.abspath(out_path)
     vol_path = os.path.join(path, self.to_path_str(vol_name))
   if os.path.exists(vol_path):
     raise IOError("Unpack directory already exists: "+vol_path)
   # check for meta file
   meta_path = vol_path + ".xdfmeta"
   if os.path.exists(meta_path):
     raise IOError("Unpack meta file already exists:"+meta_path)
   # check for block dev file
   blkdev_path = vol_path + ".blkdev"
   if os.path.exists(blkdev_path):
     raise IOError("Unpack blkdev file aready exists:"+blkdev_path)
   # create volume path
   self.meta_db = MetaDB()
   self.unpack_root(volume, vol_path)
   # save meta db
   self.meta_db.set_volume_name(volume.name.get_unicode())
   self.meta_db.set_root_meta_info(volume.get_meta_info())
   self.meta_db.set_dos_type(volume.boot.dos_type)
   self.meta_db.save(meta_path)
   # save boot code
   if volume.boot.boot_code != None:
     boot_code_path = vol_path + ".bootcode"
     f = open(boot_code_path,"wb")
     f.write(volume.boot.boot_code)
     f.close()
   # save blkdev
   f = open(blkdev_path,"wb")
   f.write("%s\n" % volume.blkdev.get_chs_str())
   f.close()
Beispiel #3
0
 def createCustomer(self):
     self.metaDB = MetaDB()
Beispiel #4
0
 def __init__(self, appConfig, fileMgr, regexMgr, lmLgr):
     self.lmLogger = lmLgr
     self.metaDB = MetaDB()
     self.fileManager = fileMgr
     self.regexManager = regexMgr
     self.keywordDict = {}