Example #1
0
 def do_file_diff(self, ext, base, final):
     try:
         ext = str(ext).upper()
         if ext == 'QS':
             return flpatchqs.diff_qs(self, base, final)
         if ext == 'QSDIR':
             return flpatchqs.diff_qs_dir(self, base, final)
         if ext == 'PY':
             aBase = base.split("/")
             nom = aBase[-1:][0]
             if nom.startswith("test_"):
                 return flpatchtest.diff_test(self, base, final)
             elif nom.endswith("_ut.py"):
                 return flpatchpy.diff_py(self, base, final)
             elif nom.endswith("_def.py"):
                 return flpatchpy.diff_py(self, base, final)
             elif "models" in base or "pruebasqs" in base:
                 return flpatchmodel.diff_model(self, base, final)
             else:
                 return flpatchpy.diff_py(self, base, final)
         #if ext == 'XML': return flpatchxml.diff_xml(self,base,final)
         if ext == 'XML': return flpatchlxml.diff_lxml(self, base, final)
         print "Unknown $ext %s" % (repr(ext))
     except Exception, e:
         self.exception(type(e).__name__, str(e))
    def compute_patch_script(self, patchscript):
        patchscript.set("style", self.iface.patch_qs_style_name)
        path = patchscript.get("path")
        filename = patchscript.get("name")

        pathname = os.path.join(path, filename)
        dst = os.path.join(self.patchdir,filename)
        base = os.path.join(self.basedir,pathname)
        final = os.path.join(self.finaldir,pathname)
    
        self.iface.info("Generando parche QS %s . . ." % filename)
        old_output = self.iface.output
        old_verbosity = self.iface.verbosity
        self.iface.verbosity -= 2
        if self.iface.verbosity < 0: self.iface.verbosity = min([0,self.iface.verbosity])
        self.iface.set_output_file(dst)
        if self.iface.patch_qs_style_name in ['legacy']:
            ret = flpatchqs.diff_qs(self.iface,base,final)
        elif self.iface.patch_qs_style_name in ['qsdir']:
            ret = flpatchqs.diff_qs_dir(self.iface,base,final)
        else:
            raise ValueError, "patch_qs_style_name no reconocido: %s" % self.iface.patch_qs_style_name
        self.iface.output = old_output 
        self.iface.verbosity = old_verbosity
        if ret == -1:
            os.unlink(dst)
            return -1
        if not ret:
            self.iface.warn("Pudo haber algĂșn problema generando el parche QS para %s" % filename)
Example #3
0
 def do_file_diff(self, ext, base, final):
     try:
         ext = str(ext).upper()
         if ext == 'QS': return flpatchqs.diff_qs(self,base,final)
         if ext == 'QSDIR': return flpatchqs.diff_qs_dir(self,base,final)
         #if ext == 'XML': return flpatchxml.diff_xml(self,base,final)
         if ext == 'XML': return flpatchlxml.diff_lxml(self,base,final)
         print "Unknown $ext %s" % (repr(ext))
     except Exception,e:
         self.exception(type(e).__name__,str(e))
Example #4
0
 def do_file_diff(self, ext, base, final):
     try:
         ext = str(ext).upper()
         if ext == 'QS': return flpatchqs.diff_qs(self, base, final)
         if ext == 'QSDIR': return flpatchqs.diff_qs_dir(self, base, final)
         #if ext == 'XML': return flpatchxml.diff_xml(self,base,final)
         if ext == 'XML': return flpatchlxml.diff_lxml(self, base, final)
         print "Unknown $ext %s" % (repr(ext))
     except Exception, e:
         self.exception(type(e).__name__, str(e))