enebootools 2.2.2__tar.gz → 2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {enebootools-2.2.2/enebootools.egg-info → enebootools-2.4}/PKG-INFO +2 -2
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/__init__.py +1 -1
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/__init__.py +23 -1
- enebootools-2.4/enebootools/assembler/copylib.py +40 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/database.py +37 -1
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/kobjects.py +2 -2
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/autoconfig/parsers.py +3 -3
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/entry_points.py +9 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/etree/ElementPath.py +7 -7
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/etree/ElementTree.py +1 -1
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchapipy.py +8 -44
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchdir.py +7 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchlxml.py +1 -1
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchmodel.py +9 -9
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchpy.py +9 -9
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchqs.py +12 -12
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchtest.py +9 -9
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/packager/pkgjoiner.py +1 -1
- enebootools-2.4/enebootools/uiimage/__init__.py +102 -0
- enebootools-2.4/enebootools/uiimage/uiimage.py +406 -0
- {enebootools-2.2.2 → enebootools-2.4/enebootools.egg-info}/PKG-INFO +2 -2
- {enebootools-2.2.2 → enebootools-2.4}/enebootools.egg-info/SOURCES.txt +3 -0
- enebootools-2.4/enebootools.egg-info/requires.txt +2 -0
- enebootools-2.2.2/enebootools.egg-info/requires.txt +0 -2
- {enebootools-2.2.2 → enebootools-2.4}/AUTHORS +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/LICENSE.gplv3 +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/README.rst +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/__init__.pyc +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/config.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/databasemodels.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/featureconfig.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/mypeewee.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/assembler/save_auto.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/autoconfig/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/autoconfig/autoconfig.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/config/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/CA_Partners_Gestiweb.crt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/CA_Test_Partners.crt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/Eneboo_Open_Source_ERP.crt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/Partner_Test.crt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/Partner_Test.pem +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/README.txt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/certificates/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/crypto/main.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/databaseadmin/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/databaseadmin/dblayer/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/databaseadmin/dblayer/drivers.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/extracttool/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/extracttool/extractfunctions.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/etree/ElementInclude.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/etree/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/etree/cElementTree.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/peewee.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/lib/utils.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/formats/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/formats/aq23-kut.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/formats/aq23-mtd.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/formats/aq23-xml.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/formats/qt3-ts.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/formats/qt3-ui.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/index.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/patch-styles/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/patch-styles/legacy1-savepatch1.xsl +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/patch-styles/legacy1.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/etc/patch-styles/semantic1.xml +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/flpatchxml.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/projectbuilder.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/test/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/mergetool/test/test_mergetool.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/packager/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/packager/pkgsplitter.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/parseargs.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/parseargs.pyc +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/parser/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/tools/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/tools/ar2kut.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/tools/dumps.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/tools/git.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools/vcsworkflow/__init__.py +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools.egg-info/dependency_links.txt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools.egg-info/entry_points.txt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/enebootools.egg-info/top_level.txt +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/setup.cfg +0 -0
- {enebootools-2.2.2 → enebootools-2.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: enebootools
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
4
4
|
Summary: ERP tools for Eneboo
|
|
5
5
|
Home-page: https://github.com/aulla/eneboo-tools
|
|
6
6
|
Author: David Martínez Martí, José A. Fernández Fernández
|
|
@@ -26,7 +26,7 @@ Requires-Python: >=3.6.9
|
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
License-File: LICENSE.gplv3
|
|
28
28
|
License-File: AUTHORS
|
|
29
|
-
Requires-Dist: lxml
|
|
29
|
+
Requires-Dist: lxml
|
|
30
30
|
Requires-Dist: watchdog
|
|
31
31
|
Dynamic: author
|
|
32
32
|
Dynamic: author-email
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
from enebootools import EnebooToolsInterface
|
|
5
5
|
|
|
6
|
-
from enebootools.assembler import database as asmdb
|
|
6
|
+
from enebootools.assembler import copylib, database as asmdb
|
|
7
7
|
from enebootools.assembler import save_auto
|
|
8
8
|
from enebootools.tools import dumps
|
|
9
9
|
|
|
@@ -144,6 +144,18 @@ class AssemblerInterface(EnebooToolsInterface):
|
|
|
144
144
|
call_function=self.set_short_mode,
|
|
145
145
|
)
|
|
146
146
|
|
|
147
|
+
self.copy_action = self.parser.declare_action(
|
|
148
|
+
name="copy",
|
|
149
|
+
args=["ext_name", "folder"],
|
|
150
|
+
description="Copia la $ext_name y dependencias en la carpeta $folder",
|
|
151
|
+
options=[""],
|
|
152
|
+
call_function=self.do_copy_action,
|
|
153
|
+
)
|
|
154
|
+
self.copy_action.set_help_arg(
|
|
155
|
+
ext_name="Nombre de la extensión a copiar",
|
|
156
|
+
classlist="Carpeta donde se va a copiar la extensión y dependencias",
|
|
157
|
+
)
|
|
158
|
+
|
|
147
159
|
# :::: ACTIONS ::::
|
|
148
160
|
|
|
149
161
|
def do_dbupdate(self):
|
|
@@ -214,5 +226,15 @@ class AssemblerInterface(EnebooToolsInterface):
|
|
|
214
226
|
except Exception as e:
|
|
215
227
|
self.exception(type(e).__name__, str(e))
|
|
216
228
|
|
|
229
|
+
def do_copy_action(self, ext_name, folder):
|
|
230
|
+
try:
|
|
231
|
+
# 1 Comprobar si la carpeta es valida y existe
|
|
232
|
+
# 2 Sacar depednencias de extensiones y módulos
|
|
233
|
+
# 3 copiar.
|
|
234
|
+
return copylib.do_copy_action(self, ext_name, folder)
|
|
235
|
+
|
|
236
|
+
except Exception as e:
|
|
237
|
+
self.exception(type(e).__name__, str(e))
|
|
238
|
+
|
|
217
239
|
def set_short_mode(self):
|
|
218
240
|
self.short_mode = True
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import shutil
|
|
5
|
+
from enebootools.assembler import database as asmdb
|
|
6
|
+
|
|
7
|
+
def do_copy_action(iface, ext_name, dest_folder):
|
|
8
|
+
if not check_if_folder_is_valid(dest_folder):
|
|
9
|
+
return False
|
|
10
|
+
|
|
11
|
+
if os.path.exists(dest_folder):
|
|
12
|
+
shutil.rmtree(dest_folder)
|
|
13
|
+
os.makedirs(dest_folder)
|
|
14
|
+
|
|
15
|
+
features, modules = asmdb.deps(iface, ext_name)
|
|
16
|
+
# Copiamos extensiones
|
|
17
|
+
for feat in features:
|
|
18
|
+
copy_dep_to_folder(iface, feat, "features" , dest_folder)
|
|
19
|
+
for module in modules:
|
|
20
|
+
copy_dep_to_folder(iface, module, "modules", dest_folder)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
return True
|
|
25
|
+
|
|
26
|
+
def copy_dep_to_folder(iface, feat, subfolder, dest_folder):
|
|
27
|
+
orig_folder = asmdb.dep_main_folder(iface, feat)
|
|
28
|
+
final_folder = os.path.join(dest_folder, subfolder, feat)
|
|
29
|
+
#si esxiste finalfolder lo borro
|
|
30
|
+
print("Copiando %s desde %s a %s" % (feat, orig_folder, final_folder))
|
|
31
|
+
shutil.copytree(orig_folder, final_folder)
|
|
32
|
+
|
|
33
|
+
def check_if_folder_is_valid(dest_folder):
|
|
34
|
+
if not os.path.exists(dest_folder):
|
|
35
|
+
print("El directorio %s no existe" % dest_folder)
|
|
36
|
+
return False
|
|
37
|
+
if not os.path.isdir(dest_folder):
|
|
38
|
+
print("%s no es un directorio" % dest_folder)
|
|
39
|
+
return False
|
|
40
|
+
return True
|
|
@@ -21,7 +21,7 @@ from enebootools.mergetool import MergeToolInterface
|
|
|
21
21
|
from .databasemodels import KnownObjects
|
|
22
22
|
|
|
23
23
|
from .mypeewee import transactional
|
|
24
|
-
from .kobjects import ObjectIndex, FeatureObject
|
|
24
|
+
from .kobjects import ObjectIndex, FeatureObject, ModuleObject
|
|
25
25
|
|
|
26
26
|
DISABLE_AR2KUT = False
|
|
27
27
|
|
|
@@ -351,6 +351,42 @@ def test_deps(iface, feat):
|
|
|
351
351
|
print()
|
|
352
352
|
|
|
353
353
|
|
|
354
|
+
def dep_main_folder(iface, feat):
|
|
355
|
+
db = init_database()
|
|
356
|
+
obj = FeatureObject.find(feat)
|
|
357
|
+
if not obj:
|
|
358
|
+
obj = ModuleObject.find(feat)
|
|
359
|
+
|
|
360
|
+
if not obj:
|
|
361
|
+
iface.error("No se encuentra %s" % feat)
|
|
362
|
+
return
|
|
363
|
+
|
|
364
|
+
return obj.fullpath
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def deps(iface, feat):
|
|
369
|
+
db = init_database()
|
|
370
|
+
oi = ObjectIndex(iface)
|
|
371
|
+
oi.analyze_objects()
|
|
372
|
+
patchname = oi.get_patch_name(feat, default=True)
|
|
373
|
+
feature = FeatureObject.find(feat)
|
|
374
|
+
patch_folder = os.path.join(feature.fullpath, "patches", patchname)
|
|
375
|
+
|
|
376
|
+
file_index = oi.index_by_file()
|
|
377
|
+
from enebootools.mergetool.flpatchdir import FolderApplyPatch
|
|
378
|
+
|
|
379
|
+
fpatch = FolderApplyPatch(iface, patch_folder)
|
|
380
|
+
info = fpatch.get_patch_info()
|
|
381
|
+
fdep_features = feature._get_full_required_features()[:]
|
|
382
|
+
fdep_modules = feature._get_full_required_modules()[:]
|
|
383
|
+
fdep_features.append(feature.formal_name())
|
|
384
|
+
orig_fdep_features = fdep_features[:]
|
|
385
|
+
orig_fdep_modules = fdep_modules[:]
|
|
386
|
+
|
|
387
|
+
return [orig_fdep_features, orig_fdep_modules]
|
|
388
|
+
|
|
389
|
+
|
|
354
390
|
def select_option(
|
|
355
391
|
title,
|
|
356
392
|
options,
|
|
@@ -390,8 +390,8 @@ class FeatureObject(BaseObject):
|
|
|
390
390
|
srcpath = os.path.join(self.fullpath, "patches", patchdir)
|
|
391
391
|
fpatch = FolderApplyPatch(self.iface, srcpath)
|
|
392
392
|
info = fpatch.get_patch_info()
|
|
393
|
-
self.info["provides"] += info["provides"]
|
|
394
|
-
self.info["requires"] += info["requires"]
|
|
393
|
+
self.info["provides"] += info["provides"] if info else []
|
|
394
|
+
self.info["requires"] += info["requires"] if info else []
|
|
395
395
|
return self.info
|
|
396
396
|
|
|
397
397
|
# * base: compila las dependencias del proyecto (todo lo que necesitamos
|
|
@@ -12,18 +12,18 @@ def get_int(x):
|
|
|
12
12
|
def get_float(x):
|
|
13
13
|
if type(x) is int: return x
|
|
14
14
|
x = str(x)
|
|
15
|
-
if not re.match("[0-9\.]+$",x): raise ValueError("value %s is not a float" % repr(x))
|
|
15
|
+
if not re.match(r"[0-9\.]+$",x): raise ValueError("value %s is not a float" % repr(x))
|
|
16
16
|
return float(x)
|
|
17
17
|
|
|
18
18
|
def get_hostname(x):
|
|
19
19
|
x = get_string(x)
|
|
20
|
-
if not re.match("[a-z0-9\.]+$",x): raise ValueError("value %s is not a valid hostname" % repr(x))
|
|
20
|
+
if not re.match(r"[a-z0-9\.]+$",x): raise ValueError("value %s is not a valid hostname" % repr(x))
|
|
21
21
|
return x
|
|
22
22
|
|
|
23
23
|
def get_identifier(x):
|
|
24
24
|
if x == "None" or x is None: return None
|
|
25
25
|
x = get_string(x)
|
|
26
|
-
if not re.match("\w+$",x): raise ValueError("value %s is not a valid identifier" % repr(x))
|
|
26
|
+
if not re.match(r"\w+$",x): raise ValueError("value %s is not a valid identifier" % repr(x))
|
|
27
27
|
return x
|
|
28
28
|
|
|
29
29
|
def get_ipaddress(x):
|
|
@@ -46,3 +46,12 @@ def main_extract_tool():
|
|
|
46
46
|
if iface.parse_args(): # parsea los argumentos de entrada de consola
|
|
47
47
|
# Si el parseo no devuelve error,
|
|
48
48
|
iface.execute_actions() # ejecuta las acciones detectadas.
|
|
49
|
+
|
|
50
|
+
def main_uiimage():
|
|
51
|
+
from enebootools.uiimage import UIImageInterface
|
|
52
|
+
|
|
53
|
+
iface = UIImageInterface()
|
|
54
|
+
|
|
55
|
+
if iface.parse_args(): # parsea los argumentos de entrada de consola
|
|
56
|
+
# Si el parseo no devuelve error,
|
|
57
|
+
iface.execute_actions() # ejecuta las acciones detectadas.
|
|
@@ -63,11 +63,11 @@ xpath_tokenizer_re = re.compile(
|
|
|
63
63
|
"'[^']*'|\"[^\"]*\"|"
|
|
64
64
|
"::|"
|
|
65
65
|
"//?|"
|
|
66
|
-
"\.\.|"
|
|
67
|
-
"\(\)|"
|
|
68
|
-
"[/.*:\[\]\(\)@=])|"
|
|
69
|
-
"((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|"
|
|
70
|
-
"\s+"
|
|
66
|
+
r"\.\.|"
|
|
67
|
+
r"\(\)|"
|
|
68
|
+
r"[/.*:\[\]\(\)@=])|"
|
|
69
|
+
r"((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|"
|
|
70
|
+
r"\s+"
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
def xpath_tokenizer(pattern, namespaces=None):
|
|
@@ -176,7 +176,7 @@ def prepare_predicate(next, token):
|
|
|
176
176
|
if elem.get(key) == value:
|
|
177
177
|
yield elem
|
|
178
178
|
return select
|
|
179
|
-
if signature == "-" and not re.match("\d+$", predicate[0]):
|
|
179
|
+
if signature == "-" and not re.match(r"\d+$", predicate[0]):
|
|
180
180
|
# [tag]
|
|
181
181
|
tag = predicate[0]
|
|
182
182
|
def select(context, result):
|
|
@@ -184,7 +184,7 @@ def prepare_predicate(next, token):
|
|
|
184
184
|
if elem.find(tag) is not None:
|
|
185
185
|
yield elem
|
|
186
186
|
return select
|
|
187
|
-
if signature == "-='" and not re.match("\d+$", predicate[0]):
|
|
187
|
+
if signature == "-='" and not re.match(r"\d+$", predicate[0]):
|
|
188
188
|
# [tag='value']
|
|
189
189
|
tag = predicate[0]
|
|
190
190
|
value = predicate[-1]
|
|
@@ -1022,7 +1022,7 @@ _serialize = {
|
|
|
1022
1022
|
# invalid.
|
|
1023
1023
|
|
|
1024
1024
|
def register_namespace(prefix, uri):
|
|
1025
|
-
if re.match("ns\d+$", prefix):
|
|
1025
|
+
if re.match(r"ns\d+$", prefix):
|
|
1026
1026
|
raise ValueError("Prefix format reserved for internal use")
|
|
1027
1027
|
for k, v in list(_namespace_map.items()):
|
|
1028
1028
|
if k == uri or v == prefix:
|
|
@@ -155,7 +155,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
155
155
|
line2 = latin1_to_ascii(line)
|
|
156
156
|
m = re.search(r"#\s*@\s*([\w\.,;-]+)\s+([^ #]+)", line2)
|
|
157
157
|
if m:
|
|
158
|
-
m2 = re.search("^\s*# @(\w+)( \w+)", line)
|
|
158
|
+
m2 = re.search(r"^\s*# @(\w+)( \w+)", line)
|
|
159
159
|
if not m2:
|
|
160
160
|
iface.warn("Formato incorrecto de la linea %s" % repr(line))
|
|
161
161
|
dtype = m.group(1)
|
|
@@ -174,7 +174,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
174
174
|
for l in class_lines[:32]:
|
|
175
175
|
# m = re.search("class\s+(?P<cname>\w+)\(((?P<cbase>\w+),)?(((?P<cfrom>\w.)+))\)",l)
|
|
176
176
|
m = re.search(
|
|
177
|
-
"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", l
|
|
177
|
+
r"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", l
|
|
178
178
|
)
|
|
179
179
|
if m:
|
|
180
180
|
heu_cname = m.group("cname")
|
|
@@ -184,46 +184,10 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
184
184
|
if heu_dtype is None:
|
|
185
185
|
heu_cnames = []
|
|
186
186
|
other_functions = []
|
|
187
|
-
""" for l in class_lines:
|
|
188
|
-
m = re.search("def\s+(?P<cname>[a-zA-Z0-9]+)_\w+", l)
|
|
189
|
-
if m:
|
|
190
|
-
heu_cname = m.group("cname")
|
|
191
|
-
if heu_cname not in heu_cnames:
|
|
192
|
-
heu_cnames.append(heu_cname)
|
|
193
|
-
if heu_cname != cname:
|
|
194
|
-
other_functions.append(l)
|
|
195
|
-
if len(heu_cnames) > 1:
|
|
196
|
-
iface.error(
|
|
197
|
-
"En la clase %s existen funciones para diferentes clases (file: %s)"
|
|
198
|
-
% (cname, file_name)
|
|
199
|
-
)
|
|
200
|
-
for l in other_functions:
|
|
201
|
-
iface.error(">>>" + l)
|
|
202
|
-
|
|
203
|
-
if cname in heu_cnames:
|
|
204
|
-
heu_cname = cname """
|
|
205
187
|
|
|
206
188
|
if heu_cname:
|
|
207
189
|
heu_dtype = "class_definition"
|
|
208
190
|
|
|
209
|
-
""" if heu_dtype and dtype != "delete_class":
|
|
210
|
-
heu_line = "# @%s %s #" % (heu_dtype, heu_cname)
|
|
211
|
-
myline = "# @%s %s #" % (dtype, cname)
|
|
212
|
-
if "_" in cname:
|
|
213
|
-
iface.info(
|
|
214
|
-
"La autodetección de contenido de bloques no funciona con clases que contengan el carácter de guión bajo como %r"
|
|
215
|
-
% cname
|
|
216
|
-
)
|
|
217
|
-
elif heu_line != myline:
|
|
218
|
-
iface.error(
|
|
219
|
-
"La definición de bloque %r no corresponde con el contenido (file: %s:%d) ... asumiendo '%s'"
|
|
220
|
-
% (line2.strip(), file_name, n, heu_line)
|
|
221
|
-
)
|
|
222
|
-
dtype, cname = heu_dtype, heu_cname
|
|
223
|
-
classpatch += ["@@ -%d,1 +%d,1 @@" % (n + 1, n + 1)]
|
|
224
|
-
classpatch += ["-%s" % line2.rstrip()]
|
|
225
|
-
classpatch += ["+%s" % heu_line] """
|
|
226
|
-
|
|
227
191
|
npos = len(linelist)
|
|
228
192
|
if dtype == "class_declaration":
|
|
229
193
|
if cname in classes:
|
|
@@ -284,7 +248,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
284
248
|
linelist[-1].append(n)
|
|
285
249
|
linelist.append(found)
|
|
286
250
|
# const iface = new ifaceCtx( this );
|
|
287
|
-
m = re.search("self.iface\s*=\s*(?P<classname>\w+)\(\s*self\s*\)", line)
|
|
251
|
+
m = re.search(r"self.iface\s*=\s*(?P<classname>\w+)\(\s*self\s*\)", line)
|
|
288
252
|
|
|
289
253
|
if m:
|
|
290
254
|
iface_n = {
|
|
@@ -312,7 +276,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
312
276
|
def extract_class_decl_info(iface, text_lines):
|
|
313
277
|
classdict = {}
|
|
314
278
|
for n, line in enumerate(text_lines):
|
|
315
|
-
m = re.search("class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", line)
|
|
279
|
+
m = re.search(r"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", line)
|
|
316
280
|
if m:
|
|
317
281
|
cname = m.group("cname")
|
|
318
282
|
classdict[cname] = {
|
|
@@ -692,7 +656,7 @@ def patch_py_dir(iface, base, patch):
|
|
|
692
656
|
line = line.strip()
|
|
693
657
|
if len(line) == 0:
|
|
694
658
|
continue
|
|
695
|
-
match = re.match("^([\w,]+) \((\w+)\) ([\w,]+)", line)
|
|
659
|
+
match = re.match(r"^([\w,]+) \((\w+)\) ([\w,]+)", line)
|
|
696
660
|
if not match:
|
|
697
661
|
iface.error("Línea de movimiento de clases malformada: %s" % (repr(line)))
|
|
698
662
|
continue
|
|
@@ -1292,7 +1256,7 @@ def diff_py_dir(iface, base, final):
|
|
|
1292
1256
|
prev_lines, post_lines = unprinted_lines[:idx], unprinted_lines[idx + 1 :]
|
|
1293
1257
|
if len(prev_lines) > 3:
|
|
1294
1258
|
for j in reversed(prev_lines):
|
|
1295
|
-
if re.search("^\s*(def|class) ", diff[j]):
|
|
1259
|
+
if re.search(r"^\s*(def|class) ", diff[j]):
|
|
1296
1260
|
break
|
|
1297
1261
|
omitted = len(prev_lines[: prev_lines.index(j)])
|
|
1298
1262
|
if omitted > 20:
|
|
@@ -1971,7 +1935,7 @@ def fix_class(iface, flbase, clbase, cdbase, classname, **updates):
|
|
|
1971
1935
|
end_line = clbase["list"][decl_block_no][3]
|
|
1972
1936
|
for n, line in enumerate(flbase[line_no:end_line], line_no):
|
|
1973
1937
|
m_it = re.finditer(
|
|
1974
|
-
"def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)",
|
|
1938
|
+
r"def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)",
|
|
1975
1939
|
line,
|
|
1976
1940
|
)
|
|
1977
1941
|
for m in m_it:
|
|
@@ -2005,7 +1969,7 @@ def check_class(iface, flbase, clbase, cdbase, classname):
|
|
|
2005
1969
|
for n, line in enumerate(flbase[line_no:end_line], line_no):
|
|
2006
1970
|
# match = list(re.finditer("def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)", line))
|
|
2007
1971
|
match = list(
|
|
2008
|
-
re.finditer("super\((?P<fname>\w+),\s*self\)\.__init__\(\s*context\s*\)", line)
|
|
1972
|
+
re.finditer(r"super\((?P<fname>\w+),\s*self\)\.__init__\(\s*context\s*\)", line)
|
|
2009
1973
|
)
|
|
2010
1974
|
if match:
|
|
2011
1975
|
line_found.append(line)
|
|
@@ -159,6 +159,9 @@ class FolderApplyPatch(object):
|
|
|
159
159
|
actionname = action.tag.split("}")[1]
|
|
160
160
|
actionname = actionname.lower()
|
|
161
161
|
|
|
162
|
+
if ":" in actionname:
|
|
163
|
+
actionname = actionname.split(":")[1]
|
|
164
|
+
|
|
162
165
|
pathname = os.path.join(action.get("path"), action.get("name"))
|
|
163
166
|
|
|
164
167
|
atype = None
|
|
@@ -170,6 +173,10 @@ class FolderApplyPatch(object):
|
|
|
170
173
|
atype = "requires"
|
|
171
174
|
elif actionname == "patchxml":
|
|
172
175
|
atype = "requires"
|
|
176
|
+
elif actionname == "patchpy":
|
|
177
|
+
atype = "requires"
|
|
178
|
+
elif actionname == "deletefile":
|
|
179
|
+
continue
|
|
173
180
|
info[atype].append(pathname)
|
|
174
181
|
return info
|
|
175
182
|
|
|
@@ -862,7 +862,7 @@ class XMLDiffer(object):
|
|
|
862
862
|
newelement = e
|
|
863
863
|
|
|
864
864
|
if newelement is None: # Intentar mas a fondo:
|
|
865
|
-
m = re.match("(\w+)\[(\w+),(\d+)\]", p0)
|
|
865
|
+
m = re.match(r"(\w+)\[(\w+),(\d+)\]", p0)
|
|
866
866
|
if m:
|
|
867
867
|
tagname = m.group(1)
|
|
868
868
|
number = int(m.group(3)) - 1
|
|
@@ -154,7 +154,7 @@ def modelclass_reader(iface, file_name, file_lines):
|
|
|
154
154
|
line2 = latin1_to_ascii(line)
|
|
155
155
|
m = re.search(r"#\s*@\s*([\w\.,;-]+)\s+([^ #]+)", line2)
|
|
156
156
|
if m:
|
|
157
|
-
m2 = re.search("^\s*# @(\w+)( \w+)", line)
|
|
157
|
+
m2 = re.search(r"^\s*# @(\w+)( \w+)", line)
|
|
158
158
|
if not m2:
|
|
159
159
|
iface.warn("Formato incorrecto de la linea %s" % repr(line))
|
|
160
160
|
dtype = m.group(1)
|
|
@@ -173,7 +173,7 @@ def modelclass_reader(iface, file_name, file_lines):
|
|
|
173
173
|
for l in class_lines[:32]:
|
|
174
174
|
# m = re.search("class\s+(?P<cname>\w+)\(((?P<cbase>\w+),)?(((?P<cfrom>\w.)+))\)",l)
|
|
175
175
|
m = re.search(
|
|
176
|
-
"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", l
|
|
176
|
+
r"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", l
|
|
177
177
|
)
|
|
178
178
|
if m:
|
|
179
179
|
heu_cname = m.group("cname")
|
|
@@ -184,7 +184,7 @@ def modelclass_reader(iface, file_name, file_lines):
|
|
|
184
184
|
heu_cnames = []
|
|
185
185
|
other_functions = []
|
|
186
186
|
for l in class_lines:
|
|
187
|
-
m = re.search("def\s+(?P<cname>[a-zA-Z0-9]+)_\w+", l)
|
|
187
|
+
m = re.search(r"def\s+(?P<cname>[a-zA-Z0-9]+)_\w+", l)
|
|
188
188
|
if m:
|
|
189
189
|
heu_cname = m.group("cname")
|
|
190
190
|
if heu_cname not in heu_cnames:
|
|
@@ -283,7 +283,7 @@ def modelclass_reader(iface, file_name, file_lines):
|
|
|
283
283
|
linelist[-1].append(n)
|
|
284
284
|
linelist.append(found)
|
|
285
285
|
# const iface = new ifaceCtx( this );
|
|
286
|
-
m = re.search("self.iface\s*=\s*(?P<classname>\w+)\(\s*self\s*\)", line)
|
|
286
|
+
m = re.search(r"self.iface\s*=\s*(?P<classname>\w+)\(\s*self\s*\)", line)
|
|
287
287
|
|
|
288
288
|
if m:
|
|
289
289
|
iface_n = {
|
|
@@ -311,7 +311,7 @@ def modelclass_reader(iface, file_name, file_lines):
|
|
|
311
311
|
def extract_class_decl_info(iface, text_lines):
|
|
312
312
|
classdict = {}
|
|
313
313
|
for n, line in enumerate(text_lines):
|
|
314
|
-
m = re.search("class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", line)
|
|
314
|
+
m = re.search(r"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", line)
|
|
315
315
|
if m:
|
|
316
316
|
cname = m.group("cname")
|
|
317
317
|
classdict[cname] = {
|
|
@@ -691,7 +691,7 @@ def patch_model_dir(iface, base, patch):
|
|
|
691
691
|
line = line.strip()
|
|
692
692
|
if len(line) == 0:
|
|
693
693
|
continue
|
|
694
|
-
match = re.match("^([\w,]+) \((\w+)\) ([\w,]+)", line)
|
|
694
|
+
match = re.match(r"^([\w,]+) \((\w+)\) ([\w,]+)", line)
|
|
695
695
|
if not match:
|
|
696
696
|
iface.error("Línea de movimiento de clases malformada: %s" % (repr(line)))
|
|
697
697
|
continue
|
|
@@ -1291,7 +1291,7 @@ def diff_model_dir(iface, base, final):
|
|
|
1291
1291
|
prev_lines, post_lines = unprinted_lines[:idx], unprinted_lines[idx + 1 :]
|
|
1292
1292
|
if len(prev_lines) > 3:
|
|
1293
1293
|
for j in reversed(prev_lines):
|
|
1294
|
-
if re.search("^\s*(def|class) ", diff[j]):
|
|
1294
|
+
if re.search(r"^\s*(def|class) ", diff[j]):
|
|
1295
1295
|
break
|
|
1296
1296
|
omitted = len(prev_lines[: prev_lines.index(j)])
|
|
1297
1297
|
if omitted > 20:
|
|
@@ -1986,7 +1986,7 @@ def fix_class(iface, flbase, clbase, cdbase, classname, **updates):
|
|
|
1986
1986
|
end_line = clbase["list"][decl_block_no][3]
|
|
1987
1987
|
for n, line in enumerate(flbase[line_no:end_line], line_no):
|
|
1988
1988
|
m_it = re.finditer(
|
|
1989
|
-
"def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)",
|
|
1989
|
+
r"def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)",
|
|
1990
1990
|
line,
|
|
1991
1991
|
)
|
|
1992
1992
|
for m in m_it:
|
|
@@ -2020,7 +2020,7 @@ def check_class(iface, flbase, clbase, cdbase, classname):
|
|
|
2020
2020
|
for n, line in enumerate(flbase[line_no:end_line], line_no):
|
|
2021
2021
|
# match = list(re.finditer("def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)", line))
|
|
2022
2022
|
match = list(
|
|
2023
|
-
re.finditer("super\((?P<fname>\w+),\s*self\)\.__init__\(\s*context\s*\)", line)
|
|
2023
|
+
re.finditer(r"super\((?P<fname>\w+),\s*self\)\.__init__\(\s*context\s*\)", line)
|
|
2024
2024
|
)
|
|
2025
2025
|
if match:
|
|
2026
2026
|
line_found.append(line)
|
|
@@ -154,7 +154,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
154
154
|
line2 = latin1_to_ascii(line)
|
|
155
155
|
m = re.search(r"#\s*@\s*([\w\.,;-]+)\s+([^ #]+)", line2)
|
|
156
156
|
if m:
|
|
157
|
-
m2 = re.search("^\s*# @(\w+)( \w+)", line)
|
|
157
|
+
m2 = re.search(r"^\s*# @(\w+)( \w+)", line)
|
|
158
158
|
if not m2:
|
|
159
159
|
iface.warn("Formato incorrecto de la linea %s" % repr(line))
|
|
160
160
|
dtype = m.group(1)
|
|
@@ -173,7 +173,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
173
173
|
for l in class_lines[:32]:
|
|
174
174
|
# m = re.search("class\s+(?P<cname>\w+)\(((?P<cbase>\w+),)?(((?P<cfrom>\w.)+))\)",l)
|
|
175
175
|
m = re.search(
|
|
176
|
-
"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", l
|
|
176
|
+
r"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", l
|
|
177
177
|
)
|
|
178
178
|
if m:
|
|
179
179
|
heu_cname = m.group("cname")
|
|
@@ -184,7 +184,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
184
184
|
heu_cnames = []
|
|
185
185
|
other_functions = []
|
|
186
186
|
for l in class_lines:
|
|
187
|
-
m = re.search("def\s+(?P<cname>[a-zA-Z0-9]+)_\w+", l)
|
|
187
|
+
m = re.search(r"def\s+(?P<cname>[a-zA-Z0-9]+)_\w+", l)
|
|
188
188
|
if m:
|
|
189
189
|
heu_cname = m.group("cname")
|
|
190
190
|
if heu_cname not in heu_cnames:
|
|
@@ -283,7 +283,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
283
283
|
linelist[-1].append(n)
|
|
284
284
|
linelist.append(found)
|
|
285
285
|
# const iface = new ifaceCtx( this );
|
|
286
|
-
m = re.search("self.iface\s*=\s*(?P<classname>\w+)\(\s*self\s*\)", line)
|
|
286
|
+
m = re.search(r"self.iface\s*=\s*(?P<classname>\w+)\(\s*self\s*\)", line)
|
|
287
287
|
|
|
288
288
|
if m:
|
|
289
289
|
iface_n = {
|
|
@@ -311,7 +311,7 @@ def pyclass_reader(iface, file_name, file_lines):
|
|
|
311
311
|
def extract_class_decl_info(iface, text_lines):
|
|
312
312
|
classdict = {}
|
|
313
313
|
for n, line in enumerate(text_lines):
|
|
314
|
-
m = re.search("class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", line)
|
|
314
|
+
m = re.search(r"class\s+(?P<cname>([\w.])+)\(((?P<cbase>.+))(,(?P<cfrom>([\w.])+))?\)", line)
|
|
315
315
|
if m:
|
|
316
316
|
cname = m.group("cname")
|
|
317
317
|
classdict[cname] = {
|
|
@@ -691,7 +691,7 @@ def patch_py_dir(iface, base, patch):
|
|
|
691
691
|
line = line.strip()
|
|
692
692
|
if len(line) == 0:
|
|
693
693
|
continue
|
|
694
|
-
match = re.match("^([\w,]+) \((\w+)\) ([\w,]+)", line)
|
|
694
|
+
match = re.match(r"^([\w,]+) \((\w+)\) ([\w,]+)", line)
|
|
695
695
|
if not match:
|
|
696
696
|
iface.error("Línea de movimiento de clases malformada: %s" % (repr(line)))
|
|
697
697
|
continue
|
|
@@ -1291,7 +1291,7 @@ def diff_py_dir(iface, base, final):
|
|
|
1291
1291
|
prev_lines, post_lines = unprinted_lines[:idx], unprinted_lines[idx + 1 :]
|
|
1292
1292
|
if len(prev_lines) > 3:
|
|
1293
1293
|
for j in reversed(prev_lines):
|
|
1294
|
-
if re.search("^\s*(def|class) ", diff[j]):
|
|
1294
|
+
if re.search(r"^\s*(def|class) ", diff[j]):
|
|
1295
1295
|
break
|
|
1296
1296
|
omitted = len(prev_lines[: prev_lines.index(j)])
|
|
1297
1297
|
if omitted > 20:
|
|
@@ -1970,7 +1970,7 @@ def fix_class(iface, flbase, clbase, cdbase, classname, **updates):
|
|
|
1970
1970
|
end_line = clbase["list"][decl_block_no][3]
|
|
1971
1971
|
for n, line in enumerate(flbase[line_no:end_line], line_no):
|
|
1972
1972
|
m_it = re.finditer(
|
|
1973
|
-
"def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)",
|
|
1973
|
+
r"def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)",
|
|
1974
1974
|
line,
|
|
1975
1975
|
)
|
|
1976
1976
|
for m in m_it:
|
|
@@ -2004,7 +2004,7 @@ def check_class(iface, flbase, clbase, cdbase, classname):
|
|
|
2004
2004
|
for n, line in enumerate(flbase[line_no:end_line], line_no):
|
|
2005
2005
|
# match = list(re.finditer("def\s*__init__\(self, context\s*=\s*None\):\n\s*super\(?P<fname>\w+,\s*self\)\.__init__\(\s*context\s*\)", line))
|
|
2006
2006
|
match = list(
|
|
2007
|
-
re.finditer("super\((?P<fname>\w+),\s*self\)\.__init__\(\s*context\s*\)", line)
|
|
2007
|
+
re.finditer(r"super\((?P<fname>\w+),\s*self\)\.__init__\(\s*context\s*\)", line)
|
|
2008
2008
|
)
|
|
2009
2009
|
if match:
|
|
2010
2010
|
line_found.append(line)
|