Re: [pyxb-users] How to import the gmd module from opengis.iso19139?
Brought to you by:
pabigot
From: Peter B. <bi...@ac...> - 2013-10-09 18:06:29
|
Try: import pyxb.bundles.opengis.iso19139.v20070417.gmd as gmd As of PyXB 1.2.3 the bindings are generated with this path, since the actual path is not permitted by Python. If you're using an older version of Python, update or edit the genbind script in the opengis bundle to correct the path as show below. Peter commit 7c7ebf682abff50835baad0fdd962a402791346b Author: Peter A. Bigot <pa...@pa...> Date: Sun Sep 15 15:03:17 2013 -0500 opengis: fix invalid module path Module components must be valid Python identifiers diff --git a/pyxb/bundles/opengis/scripts/genbind b/pyxb/bundles/opengis/scripts/genbind index 5f7a64d..8d191df 100755 --- a/pyxb/bundles/opengis/scripts/genbind +++ b/pyxb/bundles/opengis/scripts/genbind @@ -45,12 +45,12 @@ pyxbgen \ pyxbgen \ --location-prefix-rewrite=http://schemas.opengis.net/=${SCHEMA_DIR}/ \ --schema-location=${SCHEMA_DIR}/gml/3.2.1/gml.xsd --module=gml_3_2 \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gco/gco.xsd --module=iso19139.20070417.gco \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmd/gmd.xsd --module=iso19139.20070417.gmd \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmx/gmx.xsd --module=iso19139.20070417.gmx \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gsr/gsr.xsd --module=iso19139.20070417.gsr \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gss/gss.xsd --module=iso19139.20070417.gss \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gts/gts.xsd --module=iso19139.20070417.gts \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gco/gco.xsd --module=iso19139.v20070417.gco \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmd/gmd.xsd --module=iso19139.v20070417.gmd \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmx/gmx.xsd --module=iso19139.v20070417.gmx \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gsr/gsr.xsd --module=iso19139.v20070417.gsr \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gss/gss.xsd --module=iso19139.v20070417.gss \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gts/gts.xsd --module=iso19139.v20070417.gts \ --module-prefix=${MODULE_PREFIX} \ --write-for-customization \ --archive-to-file=${ARCHIVE_DIR}/gml_3_2.wxs \ On Wed, Oct 9, 2013 at 12:52 PM, Ricardo Filipe Soares Garcia da <ric...@gm...> wrote: > Hi list > > I'd like to construct some objects with the iso19139 gmd module. > However, I can't seem to be able to import it. > > In my installation path I have the following: > > $SITE_PACKAGES/pyxb/bundles/opengis/iso19139/20070417/gmd.py > > I'd hoped to import the gmd module in python by doing: > > import pyxb.bundles.opengis.iso19139.20070417.gmd as gmd > > But this raises a SyntaxError. I guess the reason is that Python does not > allow module or package names to start with a number. > > Is there some other way to import this module or am I facing a bug? > > Thanks in advance > > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > |