GenerateDS

Page last edited 1 860 giorni 20 ore fa
Da wiki.betaingegneria.it.

E' un tool per creare python dagli xsd

Scaricare[modifica]

[generateDS]

Installare[modifica]

Newer versions of Python have XML support in the Python standard library. For older versions of Python, install PyXML. You can find it at: http://pyxml.sourceforge.net/

De-compress the generateDS distribution file. Use something like the following:

  tar xzvf generateDS-x.xx.tar.gz

Then, the regular Distutils commands should work:

  $ cd generateDS-x.xx
  $ python setup.py build
  running build
  running build_py
  package init file 'libgenerateDS/__init__.py' not found (or not a regular file)
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/libgenerateDS
  copying libgenerateDS/process_includes.py -> build/lib.linux-x86_64-2.7/libgenerateDS
  package init file 'libgenerateDS/gui/__init__.py' not found (or not a regular file)
  creating build/lib.linux-x86_64-2.7/libgenerateDS/gui
  copying libgenerateDS/gui/generateds_gui.py -> build/lib.linux-x86_64-2.7/libgenerateDS/gui
  copying libgenerateDS/gui/generateds_gui_session.py -> build/lib.linux-x86_64-2.7/libgenerateDS/gui
  running build_scripts
  creating build/scripts-2.7
  copying and adjusting generateDS.py -> build/scripts-2.7
  copying and adjusting process_includes.py -> build/scripts-2.7
  copying and adjusting libgenerateDS/gui/generateds_gui.py -> build/scripts-2.7
  copying and adjusting django/gends_run_gen_django.py -> build/scripts-2.7
  copying and adjusting django/gends_extract_simple_types.py -> build/scripts-2.7
  copying and adjusting django/gends_generate_django.py -> build/scripts-2.7
  changing mode of build/scripts-2.7/generateDS.py from 664 to 775
  changing mode of build/scripts-2.7/process_includes.py from 664 to 775
  changing mode of build/scripts-2.7/generateds_gui.py from 664 to 775
  changing mode of build/scripts-2.7/gends_run_gen_django.py from 664 to 775
  changing mode of build/scripts-2.7/gends_extract_simple_types.py from 664 to 775
  changing mode of build/scripts-2.7/gends_generate_django.py from 664 to 775
  $ su python setup.py install
  running install
  Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
  /usr/bin/python -E -c pass
  TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
  running bdist_egg
  running egg_info
  writing generateDS.egg-info/PKG-INFO
  writing top-level names to generateDS.egg-info/top_level.txt
  writing dependency_links to generateDS.egg-info/dependency_links.txt
  package init file 'libgenerateDS/__init__.py' not found (or not a regular file)
  package init file 'libgenerateDS/gui/__init__.py' not found (or not a regular file)
  reading manifest file 'generateDS.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'generateDS.egg-info/SOURCES.txt'
  installing library code to build/bdist.linux-x86_64/egg
  running install_lib
  running build_py
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/egg
  creating build/bdist.linux-x86_64/egg/libgenerateDS
  creating build/bdist.linux-x86_64/egg/libgenerateDS/gui
  copying build/lib.linux-x86_64-2.7/libgenerateDS/gui/generateds_gui.py -> build/bdist.linux-x86_64/egg/libgenerateDS/gui
  copying build/lib.linux-x86_64-2.7/libgenerateDS/gui/generateds_gui_session.py -> build/bdist.linux-x86_64/egg/libgenerateDS/gui
  copying build/lib.linux-x86_64-2.7/libgenerateDS/process_includes.py -> build/bdist.linux-x86_64/egg/libgenerateDS
  byte-compiling build/bdist.linux-x86_64/egg/libgenerateDS/gui/generateds_gui.py to generateds_gui.pyc
  byte-compiling build/bdist.linux-x86_64/egg/libgenerateDS/gui/generateds_gui_session.py to generateds_gui_session.pyc
  byte-compiling build/bdist.linux-x86_64/egg/libgenerateDS/process_includes.py to process_includes.pyc
  Creating missing __init__.py for libgenerateDS
  Creating missing __init__.py for libgenerateDS.gui
  byte-compiling build/bdist.linux-x86_64/egg/libgenerateDS/__init__.py to __init__.pyc
  byte-compiling build/bdist.linux-x86_64/egg/libgenerateDS/gui/__init__.py to __init__.pyc
  creating build/bdist.linux-x86_64/egg/EGG-INFO
  installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  running install_scripts
  running build_scripts
  creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  copying build/scripts-2.7/gends_extract_simple_types.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  copying build/scripts-2.7/generateds_gui.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  copying build/scripts-2.7/gends_run_gen_django.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  copying build/scripts-2.7/generateDS.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  copying build/scripts-2.7/process_includes.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  copying build/scripts-2.7/gends_generate_django.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
  changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/gends_extract_simple_types.py to 775
  changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/generateds_gui.py to 775
  changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/gends_run_gen_django.py to 775
  changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/generateDS.py to 775
  changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/process_includes.py to 775
  changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/gends_generate_django.py to 775
  copying generateDS.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
  copying generateDS.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
  copying generateDS.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
  copying generateDS.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
  zip_safe flag not set; analyzing archive contents...
  creating dist
  creating 'dist/generateDS-2.7c-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
  removing 'build/bdist.linux-x86_64/egg' (and everything under it)
  Processing generateDS-2.7c-py2.7.egg
  creating /usr/local/lib/python2.7/dist-packages/generateDS-2.7c-py2.7.egg
  Extracting generateDS-2.7c-py2.7.egg to /usr/local/lib/python2.7/dist-packages
  Adding generateDS 2.7c to easy-install.pth file
  Installing gends_extract_simple_types.py script to /usr/local/bin
  Installing generateds_gui.py script to /usr/local/bin
  Installing gends_run_gen_django.py script to /usr/local/bin
  Installing generateDS.py script to /usr/local/bin
  Installing process_includes.py script to /usr/local/bin
  Installing gends_generate_django.py script to /usr/local/bin
  
  Installed /usr/local/lib/python2.7/dist-packages/generateDS-2.7c-py2.7.egg
  Processing dependencies for generateDS==2.7c
  Finished processing dependencies for generateDS==2.7c
  

Eseguire[modifica]

  $ python generateDS.py -o servizi.py -s servizisubs.py inputCertificazioneSoggetto.xsd

vengono generati i files:

  -rw-rw-r-- 1 marcob marcob   7213 ott 26 12:31 inputCertificazioneSoggetto.xsd
  -rw-r--r-- 1 marcob marcob  11349 ott 26 12:31 process_includes.pyc
  -rw-rw-r-- 1 marcob marcob 111068 ott 26 12:30 servizi.py
  -rw-rw-r-- 1 marcob marcob   6661 ott 26 12:31 servizisubs.py

GUI[modifica]

  $ generateds_gui.py