File: xmp.py

package info (click to toggle)
exiv2 0.27.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 62,896 kB
  • sloc: cpp: 83,384; python: 8,015; sh: 1,510; makefile: 322; javascript: 237; ansic: 74; sed: 16
file content (34 lines) | stat: -rwxr-xr-x 893 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3

import sys
import csv

print("""<?xml version = '1.0'?>
<?xml-stylesheet type=\"text/xsl\" href=\"tags.xsl\"?>
<TAGLIST>
<HEADER>
<title>XMP tags defined in Exiv2</title>
<text>
<p>Some description</p>
<p>Click on a column header to sort the table.</p>
</text>
</HEADER>
<ROWSET>""")

row=0
data = sys.stdin.readlines()
print(data)
for line in csv.reader(data,quotechar='"',skipinitialspace=True):
    row=row+1
    print("   <ROW num=\"%d\">" % row) 
    print("      <tagname>"      + line[0] + "</tagname>")
    print("      <title>"        + line[1] + "</title>")
    print("      <xmpvaltype>"   + line[2] + "</xmpvaltype>")
    print("      <type>"         + line[3] + "</type>")
    print("      <category>"     + line[4] + "</category>")
    print("      <tagdesc>"      + line[5] + "</tagdesc>")
    print("   </ROW>")

print("</ROWSET>")
print("</TAGLIST>")