pombreda / python-xmp-toolkit

Automatically exported from code.google.com/p/python-xmp-toolkit
Other
0 stars 1 forks source link

Unable to get XMP field #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. from libxmp import *
2. xmpfile = XMPFiles( file_path="ECO121.pdf", open_forupdate=True )
3. xmp = xmpfile.get_xmp()
4. print xmp.get_property( libxmp.consts.XMP_NS_DC, 'format' )

What is the expected output? What do you see instead?
Expected output: "PDF-1.6"

What do I get:

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    print xmp.get_property( libxmp.consts.XMP_NS_DC, 'format' )
NameError: name 'libxmp' is not defined

What version of the product are you using? On what operating system?

python-xmp-toolkit-1.0-rc2

Ubuntu 10.04 64-bit

Python 2.6.5

Please provide any additional information below.

Original issue reported on code.google.com by Meketr...@gmail.com on 6 Sep 2010 at 5:52

GoogleCodeExporter commented 9 years ago
You're making a call to libxmp.consts.XMP_NS_DC, but libxmp isn't defined, 
because you never imported it.  Since you did a 'from libxmp import *', though, 
consts is in the scope, so make that just consts.XMP_NS_DC and you're good.

Original comment by xiong.ch...@gmail.com on 12 Sep 2010 at 3:31

GoogleCodeExporter commented 9 years ago
Hi,

I'm closing the issue. As xiong.chiamiov pointed out, just replace 
libxmp.consts.XMP_NS_DC with consts.XMP_NS_DC.

Cheers,
Lars

Original comment by lniel...@spacetelescope.org on 13 Sep 2010 at 6:49