Permalink
Browse files

Cross compatible code for python and jar version

  • Loading branch information...
1 parent d8a7ce6 commit 6430bbc8a5b72a02f08a973b7fbdd112a17ff501 techmaurice committed Mar 4, 2011
Showing with 3,116 additions and 3,116 deletions.
  1. +2,355 −2,355 fido/argparselocal.py
  2. +173 −173 fido/conf/fido-formats.xsd
  3. 0 fido/conf/format_extension_template.xml
  4. +1 −1 fido/fetch.sh
  5. +2 −2 fido/fido.bat
  6. +1 −1 fido/fido.sh
  7. +491 −491 fido/prepare.py
  8. +93 −93 fido/testfido.py
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,173 +1,173 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Usage of DC has been based on these references:
- http://dublincore.org/documents/usageguide/elements.shtml
- http://dublincore.org/documents/usageguide/qualifiers.shtml
- http://www.dublincore.org/documents/dc-xml-guidelines/
--->
-<xs:schema elementFormDefault="qualified"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:dcterms="http://purl.org/dc/terms/">
- <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd"/>
- <xs:import namespace="http://purl.org/dc/terms/" schemaLocation="dcterms.xsd"/>
-<!-- http://www.dublincore.org/schemas/xmls/qdc/2003/04/02/dcterms.xsd" -->
- <xs:element name="formats">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" ref="format"/>
- </xs:sequence>
- <xs:attribute name="version" type="xs:decimal" use="required"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="format">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="1" minOccurs="1" ref="puid"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="mime"/>
- <xs:element minOccurs="0" ref="container"/>
- <xs:element maxOccurs="1" minOccurs="1" ref="name"/>
- <xs:element maxOccurs="1" minOccurs="0" name="version" type="xs:string"/>
- <xs:element minOccurs="0" name="alias" type="xs:string"/>
- <xs:element maxOccurs="1" minOccurs="0" ref="pronom_id"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="extension"/>
- <xs:element maxOccurs="1" minOccurs="0" name="apple_uti" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="has_priority_over"/>
- <xs:element maxOccurs="unbounded" ref="signature"/>
- <xs:element minOccurs="0" ref="note"/>
- <xs:element maxOccurs="1" ref="details"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="mime" type="xs:string"/>
- <xs:element name="puid" type="xs:string"/>
- <xs:element name="container" type="container_type"/>
- <xs:element name="pronom_id" type="xs:integer"/>
- <xs:element name="extension" type="xs:string"/>
- <xs:element name="has_priority_over" type="xs:string"/>
- <xs:element name="signature">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="name"/>
- <xs:element ref="note" minOccurs="0" maxOccurs="unbounded"/>
- <xs:element maxOccurs="unbounded" ref="pattern"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="note" type="xs:string"/>
- <xs:element name="pattern">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="position"/>
- <xs:element ref="pronom_pattern" minOccurs="0"/>
- <xs:element ref="regex" minOccurs="1" maxOccurs="1" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="position" type="position_type"/>
- <xs:element name="pronom_pattern" type="xs:string"/>
- <xs:element name="regex" type="xs:string"/>
- <xs:element name="name" type="xs:string"/>
- <xs:simpleType name="position_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="BOF"/>
- <xs:enumeration value="EOF"/>
- <xs:enumeration value="VAR"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="container_type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="zip"/>
- <xs:enumeration value="tar"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:element name="details">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="1" minOccurs="0" ref="dc:description"/>
- <xs:element maxOccurs="1" minOccurs="0" ref="dcterms:available"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="dc:creator"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="dcterms:publisher"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="is_supertype_of" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" name="is_subtype_of" type="xs:string"/>
- <xs:element maxOccurs="1" minOccurs="0" name="content_type" type="xs:string"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="reference"/>
- <xs:element maxOccurs="unbounded" minOccurs="0" ref="example_file"/>
- <xs:element maxOccurs="1" minOccurs="0" ref="record_metadata"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="reference">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="1" minOccurs="0" name="type" type="xs:string"/>
- <xs:element maxOccurs="unbounded" ref="dc:any"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="example_file">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="unbounded" ref="dc:any"/>
- <xs:element minOccurs="1" ref="checksum"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="record_metadata">
- <xs:complexType>
- <xs:sequence>
- <xs:element maxOccurs="1" minOccurs="1" ref="status"/>
- <xs:element maxOccurs="unbounded" ref="dc:any"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="checksum">
- <xs:complexType mixed="true">
- <xs:sequence>
- </xs:sequence>
- <xs:attribute name="type" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="md5"/>
- <xs:enumeration value="sha256"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="status">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="unknown"/>
- <xs:enumeration value="invalid"/>
- <xs:enumeration value="incomplete"/>
- <xs:enumeration value="stub"/>
- <xs:enumeration value="adequate"/>
- <xs:enumeration value="complete"/>
- <xs:enumeration value="superb"/>
- <xs:enumeration value="deprecated"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element name="content_type">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="raster"/>
- <xs:enumeration value="vector"/>
- <xs:enumeration value="image"/>
- <xs:enumeration value="spreadsheet"/>
- <xs:enumeration value="text"/>
- <xs:enumeration value="word-processed"/>
- <xs:enumeration value="page-description"/>
- <xs:enumeration value="audio"/>
- <xs:enumeration value="presentation"/>
- <xs:enumeration value="mark-up"/>
- <xs:enumeration value="database"/>
- <xs:enumeration value="video"/>
- <xs:enumeration value="email"/>
- <xs:enumeration value="other"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Usage of DC has been based on these references:
+ http://dublincore.org/documents/usageguide/elements.shtml
+ http://dublincore.org/documents/usageguide/qualifiers.shtml
+ http://www.dublincore.org/documents/dc-xml-guidelines/
+-->
+<xs:schema elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:dcterms="http://purl.org/dc/terms/">
+ <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd"/>
+ <xs:import namespace="http://purl.org/dc/terms/" schemaLocation="dcterms.xsd"/>
+<!-- http://www.dublincore.org/schemas/xmls/qdc/2003/04/02/dcterms.xsd" -->
+ <xs:element name="formats">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="format"/>
+ </xs:sequence>
+ <xs:attribute name="version" type="xs:decimal" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="format">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="1" minOccurs="1" ref="puid"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="mime"/>
+ <xs:element minOccurs="0" ref="container"/>
+ <xs:element maxOccurs="1" minOccurs="1" ref="name"/>
+ <xs:element maxOccurs="1" minOccurs="0" name="version" type="xs:string"/>
+ <xs:element minOccurs="0" name="alias" type="xs:string"/>
+ <xs:element maxOccurs="1" minOccurs="0" ref="pronom_id"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="extension"/>
+ <xs:element maxOccurs="1" minOccurs="0" name="apple_uti" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="has_priority_over"/>
+ <xs:element maxOccurs="unbounded" ref="signature"/>
+ <xs:element minOccurs="0" ref="note"/>
+ <xs:element maxOccurs="1" ref="details"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="mime" type="xs:string"/>
+ <xs:element name="puid" type="xs:string"/>
+ <xs:element name="container" type="container_type"/>
+ <xs:element name="pronom_id" type="xs:integer"/>
+ <xs:element name="extension" type="xs:string"/>
+ <xs:element name="has_priority_over" type="xs:string"/>
+ <xs:element name="signature">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name"/>
+ <xs:element ref="note" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element maxOccurs="unbounded" ref="pattern"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="note" type="xs:string"/>
+ <xs:element name="pattern">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="position"/>
+ <xs:element ref="pronom_pattern" minOccurs="0"/>
+ <xs:element ref="regex" minOccurs="1" maxOccurs="1" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="position" type="position_type"/>
+ <xs:element name="pronom_pattern" type="xs:string"/>
+ <xs:element name="regex" type="xs:string"/>
+ <xs:element name="name" type="xs:string"/>
+ <xs:simpleType name="position_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="BOF"/>
+ <xs:enumeration value="EOF"/>
+ <xs:enumeration value="VAR"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="container_type">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="zip"/>
+ <xs:enumeration value="tar"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:element name="details">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="1" minOccurs="0" ref="dc:description"/>
+ <xs:element maxOccurs="1" minOccurs="0" ref="dcterms:available"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="dc:creator"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="dcterms:publisher"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="is_supertype_of" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="is_subtype_of" type="xs:string"/>
+ <xs:element maxOccurs="1" minOccurs="0" name="content_type" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="reference"/>
+ <xs:element maxOccurs="unbounded" minOccurs="0" ref="example_file"/>
+ <xs:element maxOccurs="1" minOccurs="0" ref="record_metadata"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="reference">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="1" minOccurs="0" name="type" type="xs:string"/>
+ <xs:element maxOccurs="unbounded" ref="dc:any"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="example_file">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="dc:any"/>
+ <xs:element minOccurs="1" ref="checksum"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="record_metadata">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="1" minOccurs="1" ref="status"/>
+ <xs:element maxOccurs="unbounded" ref="dc:any"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="checksum">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ </xs:sequence>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="md5"/>
+ <xs:enumeration value="sha256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="status">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unknown"/>
+ <xs:enumeration value="invalid"/>
+ <xs:enumeration value="incomplete"/>
+ <xs:enumeration value="stub"/>
+ <xs:enumeration value="adequate"/>
+ <xs:enumeration value="complete"/>
+ <xs:enumeration value="superb"/>
+ <xs:enumeration value="deprecated"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="content_type">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="raster"/>
+ <xs:enumeration value="vector"/>
+ <xs:enumeration value="image"/>
+ <xs:enumeration value="spreadsheet"/>
+ <xs:enumeration value="text"/>
+ <xs:enumeration value="word-processed"/>
+ <xs:enumeration value="page-description"/>
+ <xs:enumeration value="audio"/>
+ <xs:enumeration value="presentation"/>
+ <xs:enumeration value="mark-up"/>
+ <xs:enumeration value="database"/>
+ <xs:enumeration value="video"/>
+ <xs:enumeration value="email"/>
+ <xs:enumeration value="other"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+</xs:schema>
View
No changes.
View
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash
base="http://www.nationalarchives.gov.uk/pronom/"
re='PUID=\"(fmt|x-fmt)/([0-9]+)\"'
View
@@ -1,3 +1,3 @@
-@echo off
-:: Fido Script for Windows XP
+@echo off
+:: Fido Script for Windows XP
python -u -m fido.fido %*
View
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!/bin/sh
python -u -m fido.fido $*
Oops, something went wrong.

0 comments on commit 6430bbc

Please sign in to comment.