def new_file(self, cv5=None, vf4=None, vx4=None, vr4=None, dddata=None, wpe=None): if cv5: self.cv5 = cv5 else: self.cv5 = CV5() if vf4: self.vf4 = vf4 else: self.vf4 = VF4() if vx4: self.vx4 = vx4 else: self.vx4 = VX4() if vr4: self.vr4 = vr4 else: self.vr4 = VR4() if dddata: self.dddata = dddata else: self.dddata = DDDataBIN() if wpe: self.wpe = wpe else: self.wpe = PAL.Palette()
def load_file(self, cv5, vf4=None, vx4=None, vr4=None, dddata=None, wpe=None): path = None name = None if isstr(cv5): path = os.path.dirname(cv5) name = os.path.basename(cv5) if name.split(os.extsep)[-1].lower() == 'cv5': name = name[:-4] if not vf4: if not path or not name: raise vf4 = os.path.join(path, '%s%svf4' % (name, os.extsep)) if not vx4: if not path or not name: raise vx4 = os.path.join(path, '%s%svx4ex' % (name, os.extsep)) # Check for and prefer expanded vx4 files if not os.path.exists(vx4): vx4 = os.path.join(path, '%s%svx4' % (name, os.extsep)) if not vr4: if not path or not name: raise vr4 = os.path.join(path, '%s%svr4' % (name, os.extsep)) if not dddata: if not path or not name: raise dddata = os.path.join(path, name, 'dddata%sbin' % os.extsep) if not wpe: if not path or not name: raise wpe = os.path.join(path, '%s%swpe' % (name, os.extsep)) self.cv5 = CV5() self.cv5.load_file(cv5) self.vf4 = VF4() self.vf4.load_file(vf4) self.vx4 = VX4() self.vx4.load_file(vx4) self.vr4 = VR4() self.vr4.load_file(vr4) self.dddata = DDDataBIN() self.dddata.load_file(dddata) self.wpe = PAL.Palette() self.wpe.load_file(wpe) self.cv5_path = cv5 if isstr(cv5) else None self.vf4_path = vf4 if isstr(vf4) else None self.vx4_path = vx4 if isstr(vx4) else None self.vr4_path = vr4 if isstr(vr4) else None self.dddata_path = dddata if isstr(dddata) else None self.wpe_path = wpe if isstr(wpe) else None