From 8918d8e9844fc4255e6e5af0cbc00d9dc63560f3 Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Tue, 22 Feb 2022 17:37:25 +0100 Subject: [PATCH] modifications mineures avant merge request (rebase) --- Efi2Xsd/ajoutBalise.py | 2 +- Efi2Xsd/introspect.py | 28 ++++++++--------- Efi2Xsd/readerEfiXsd.py | 8 ++--- setup.py | 69 ++++++++++++++++++++++++++--------------- 4 files changed, 63 insertions(+), 44 deletions(-) diff --git a/Efi2Xsd/ajoutBalise.py b/Efi2Xsd/ajoutBalise.py index 21b84876..45692d3f 100644 --- a/Efi2Xsd/ajoutBalise.py +++ b/Efi2Xsd/ajoutBalise.py @@ -1,6 +1,6 @@ debuttypeChaineAvecBlancs = '\t\t\n\t\t\t \n\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t ' fintypeChaineAvecBlancs = '\t\t\n\t\t \n\t\t \n\t\t \n\t\t' -SequenceChaineAvecBlancs = '\t\t\n\t\t\t n\t\t\t <\xs:sequence>\n\t\t\n' +SequenceChaineAvecBlancs = '\t\t\n\t\t\t n\t\t\t \n\t\t\n' diff --git a/Efi2Xsd/introspect.py b/Efi2Xsd/introspect.py index 85254f94..736338e6 100644 --- a/Efi2Xsd/introspect.py +++ b/Efi2Xsd/introspect.py @@ -15,15 +15,15 @@ import Atmo.raw.atmo_test3 as raw_custom import inspect def creationAccasSimp(c): - print c + print (c) -class toto -def __init__(self,*args): - print dir(self) - mro = type(self).mro() - for next_class in mro[mro.index(ChildB) + 1:] : - if hasattr(next_class, '__init__'): - next_class.__init__(self,args) +#class toto +#def __init__(self,*args): +# print dir(self) +# mro = type(self).mro() +# for next_class in mro[mro.index(ChildB) + 1:] : +# if hasattr(next_class, '__init__'): +# next_class.__init__(self,args) # Utility function to identify classes of interest def _isSupersedable (cls): @@ -41,13 +41,13 @@ def _injectClasses (): if issubclass(c,pyxb.binding.basis.complexTypeDefinition) : raw_classes_compo.add(c) else : raw_classes_simp.add(c) #print 'Original classes complex type: %s' % (raw_classes_compo,) - print 'Original classes simple type: %s' % (raw_classes_simp,) + #print 'Original classes simple type: %s' % (raw_classes_simp,) for c in raw_classes_simp: setattr(c,'creationAccasSimp',creationAccasSimp) oldInit=c.__init__ - print c.__class__ + #print c.__class__ #setattr(c,'__init__',__init__) - print c.__mro__ + #print c.__mro__ # PyXB complex type definitions in this module that did not come # from the original import *. @@ -59,12 +59,12 @@ def _injectClasses (): # Raw classes superseded by something in this module superseded_classes = set([ _o for _o in raw_classes if _o._SupersedingClass() in this_classes ]) superseded_classes_tuple = tuple(superseded_classes) - print 'Superseded classes: %s' % (superseded_classes,) + #print 'Superseded classes: %s' % (superseded_classes,) # Raw classes that are subclasses of something superseded by this # module, but that are not themselves superseded by this module need_supersedure_classes = set([_o for _o in raw_classes if issubclass(_o, superseded_classes_tuple) and _o not in superseded_classes]) - print 'Need supersedure classes: %s' % (need_supersedure_classes,) + #print 'Need supersedure classes: %s' % (need_supersedure_classes,) # Add local definitions to supersede classes all of whose # ancestors have been superseded as necessary. @@ -106,4 +106,4 @@ def _injectClasses (): _injectClasses() m=T_Unit1(1) -print m +#print m diff --git a/Efi2Xsd/readerEfiXsd.py b/Efi2Xsd/readerEfiXsd.py index b519e99a..784abf00 100755 --- a/Efi2Xsd/readerEfiXsd.py +++ b/Efi2Xsd/readerEfiXsd.py @@ -107,7 +107,7 @@ class monSIMP (efficas.T_SIMP, objetDefinitionAccas): if self.attendTuple() : #nbDElts=type(listeDElt[0]) - print self.nomTypeAttendu + print (self.nomTypeAttendu) self.traiteLesSequences() @@ -226,7 +226,7 @@ class monPROC(efficas.T_PROC, objetComposeDefinitionAccas): # --------------------------------------------------------- def explore(self,cata): # -------------------- - print "je passe dans explore pour PROC ", self.nom + print ("je passe dans explore pour PROC ", self.nom) self.dictATraiter= dictPROCXMLEficas self.argumentXMLToEficas() self.exploreArbre(cata) @@ -241,7 +241,7 @@ class monOPER(efficas.T_OPER, objetComposeDefinitionAccas): # --------------------------------------------------------- def explore(self,cata): # ------------------------ - print "je passe dans explore pour OPER", self.nom + #print "je passe dans explore pour OPER", self.nom self.cata=cata self.dictATraiter= dictOPERXMLEficas self.argumentXMLToEficas() @@ -263,7 +263,7 @@ class monBLOC(efficas.T_BLOC, objetComposeDefinitionAccas): # --------------------------------------------------------- def explore(self,cata): # ------------------------ - print ('je passe dans explore pour BLOC', self.nom) + #print ('je passe dans explore pour BLOC', self.nom) self.cata=cata self.dictATraiter= dictBLOCXMLEficas self.argumentXMLToEficas() diff --git a/setup.py b/setup.py index 7d39f975..897db6fd 100644 --- a/setup.py +++ b/setup.py @@ -8,18 +8,31 @@ from setuptools import setup, find_packages from sphinx.setup_command import BuildDoc from InterfaceQT4 import getVersion +#from pyqt_distutils.build_ui import build_ui -#try: -# from pyqt_distutils.build_ui import build_ui -# cmdclass = {'build_ui': build_ui} -#except ImportError: -# build_ui = None # user won't have pyqt_distutils when deploying -# cmdclass = {} +import os +import pathlib maVersion = getVersion.getEficasVersion() -mesPackages=find_packages(exclude=('convert','generator')) +cmdclass = {'build_sphinx': BuildDoc } +# 'build_ui': build_ui} -print (mesPackages) +def package_files(directory,extension=None): + paths = [] + for (path, directories, filenames) in os.walk(directory): + for filename in filenames: + if extension==None : paths.append(os.path.join('..', path, filename)) + elif pathlib.Path(filename).suffix == extension : paths.append(os.path.join('..', path, filename)) + return paths + +doc_files = package_files('Doc') +aide_files = package_files('Aide') +rn_files = package_files('ReacteurNumerique') +#ui_files = package_files('UiQT5', '.ui') +pyui_files = package_files('UiQT5', '.py') +icons_files = package_files('Editeur/icons') + +packages_data_files = doc_files + aide_files + rn_files + pyui_files + icons_files setup( name="eficas_RN", @@ -29,22 +42,28 @@ setup( description=( "Tool used by the Réacteur Numérique project to " "check data validity. also provides an GUI for setting up cases"), - packages=find_packages( - where='.', - include=['Accas'], - exclude=['convert','generator'], + + packages = find_packages( + include=['Accas','Editeur', 'Efi2Xsd', 'Extensions', 'Ihm', 'InterfaceQT4', 'Noyau', 'Validation'], + exclude=['convert', 'generator'], ), - #packages=find_packages(exclude=['convert']), - #package_dir = {'': eficas}, - #packages=["Accas",], + data_files=[('convert',['convert/parseur_python.py', 'convert/__init__.py', 'convert/convert_pyth.py','convert/convert_python.py', 'convert/autre_parseur.py']), + ('generator',['generator/Formatage.py', 'generator/generator_aplat.py', 'generator/generator_python.py', 'generator/generator_XML.py', 'generator/__init__.py']), + ], - #install_requires=[ - # "sphinx>=1.0.1", - #], - #command_options={ - # 'build_sphinx': { - # 'project': ('setup.py', u'Eficas IHM'), - # 'version': ('setup.py', maVersion), - # 'source_dir': ('setup.py', 'doc')} - # }, - python_requires=">=3.1") + package_data = {'': packages_data_files ,}, + + cmdclass=cmdclass, + command_options={ + 'build_sphinx': { + 'project': ('setup.py', u'Eficas IHM'), + 'version': ('setup.py', maVersion), + 'source_dir': ('setup.py', 'Doc')}, + 'build_ui': { + 'source_dir': ('setup.py', 'UiQT5')} + }, + install_requires=[ + "sphinx>=1.0.1", + ], + python_requires=">=3.1" +) -- 2.39.2