Skip to content

Commit

Permalink
fixed container sigfile version in update_signatures, updated readme.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
techmaurice committed Aug 29, 2013
1 parent 604200f commit c7a4925
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,6 +9,7 @@
*.py~
/build
/dist
/fido.egg-info
*.~is
/.settings/org.eclipse.wst.sse.core.prefs
/.settings/org.eclipse.ltk.core.refactoring.prefs
Expand Down
69 changes: 31 additions & 38 deletions README.in
@@ -1,65 +1,58 @@
usage: fido.py [-h] [-v] [-q] [-recurse] [-zip] [-nocontainer] [-input INPUT]
[-useformats INCLUDEPUIDS] [-nouseformats EXCLUDEPUIDS]
[-matchprintf FORMATSTRING] [-nomatchprintf FORMATSTRING]
[-bufsize BUFSIZE] [-container_bufsize CONTAINER_BUFSIZE]
[-filename FILENAME] [-useformats INCLUDEPUIDS]
[-nouseformats EXCLUDEPUIDS] [-matchprintf FORMATSTRING]
[-nomatchprintf FORMATSTRING] [-bufsize BUFSIZE]
[-container_bufsize CONTAINER_BUFSIZE]
[-loadformats XML1,...,XMLn] [-confdir CONFDIR]
[FILE [FILE ...]]

Format Identification for Digital Objects (fido). FIDO is a command-line tool
to identify the file formats of digital objects. It is designed for simple
integration into automated work-flows.
Format Identification for Digital Objects (fido).
FIDO is a command-line tool to identify the file formats of digital objects.
It is designed for simple integration into automated work-flows.


positional arguments:
FILE files to check. If the file is -, then read content
from stdin. In this case, python must be invoked with
-u or it may convert the line terminators.
FILE files to check. If the file is -, then read content from stdin. In this case, python must be invoked with -u or it may convert the line terminators.

optional arguments:
-h, --help show this help message and exit
-v show version information
-q run (more) quietly
-recurse recurse into subdirectories
-zip recurse into zip and tar files
-nocontainer disable deep scan of container documents, increases
speed but may reduce accuracy with big files
-input INPUT file containing a list of files to check, one per
line. - means stdin
-nocontainer disable deep scan of container documents, increases speed but may reduce accuracy with big files
-input INPUT file containing a list of files to check, one per line. - means stdin
-filename FILENAME filename if file contents passed through STDIN
-useformats INCLUDEPUIDS
comma separated string of formats to use in
identification
comma separated string of formats to use in identification
-nouseformats EXCLUDEPUIDS
comma separated string of formats not to use in
identification
comma separated string of formats not to use in identification
-matchprintf FORMATSTRING
format string (Python style) to use on match. See
nomatchprintf, README.txt.
format string (Python style) to use on match. See nomatchprintf, README.txt.
-nomatchprintf FORMATSTRING
format string (Python style) to use if no match. See
README.txt
-bufsize BUFSIZE size (in bytes) of the buffer to match against
(default=131072 bytes)
format string (Python style) to use if no match. See README.txt
-bufsize BUFSIZE size (in bytes) of the buffer to match against (default=131072 bytes)
-container_bufsize CONTAINER_BUFSIZE
size (in bytes) of the buffer to match against
(default=524288 bytes)
size (in bytes) of the buffer to match against (default=524288 bytes)
-loadformats XML1,...,XMLn
comma separated string of XML format files to add.
-confdir CONFDIR configuration directory to load_fido_xml, for example,
the format specifications from.

Open Planets Foundation (http://www.openplanetsfoundation.org)
See License.txt for license information.
Download from: http://github.com/openplanets/fido/downloads
Author: Adam Farquhar, 2010
Maintainer: Maurice de Rooij (OPF/NANETH), 2011, 2012
FIDO uses the UK National Archives (TNA) PRONOM File Format and Container descriptions.
PRONOM is available from http://www.nationalarchives.gov.uk/pronom/
-confdir CONFDIR configuration directory to load_fido_xml, for example, the format specifications from.

Open Planets Foundation (http://www.openplanetsfoundation.org)
See License.txt for license information.
Download from: https://github.com/openplanets/fido/releases
Usage guide: http://wiki.opf-labs.org/display/TR/FIDO+usage+guide
Author: Adam Farquhar (BL), 2010
Maintainer: Maurice de Rooij (OPF/NANETH), 2011, 2012, 2013
FIDO uses the UK National Archives (TNA) PRONOM File Format
and Container descriptions.
PRONOM is available from http://www.nationalarchives.gov.uk/pronom/

Installation
------------

Any platform
1. Download the latest zip release from http://github.com/openplanets/fido/downloads
(or use the big Downloads button on http://github.com/openplanets/fido)
1. Download the latest zip release from https://github.com/openplanets/fido/releases
2. Unzip into some directory
3. Open a command shell, cd to the directory that you placed the zip contents into and cd into folder 'fido'
4. You should now be able to see the help text:
Expand Down Expand Up @@ -116,7 +109,7 @@ The defaults for FIDO 1.0 are:
It can be useful to provide an empty string for either, for example to ignore all failed matches, or all successful ones (see examples below).
Note that a newline needs to be added to the end of the string using \n.

Matchttypes
Matchtypes
-----------

FIDO returns the following matchtypes:
Expand Down
83 changes: 45 additions & 38 deletions README.txt
@@ -1,65 +1,72 @@
usage: fido.py [-h] [-v] [-q] [-recurse] [-zip] [-nocontainer] [-input INPUT]
[-useformats INCLUDEPUIDS] [-nouseformats EXCLUDEPUIDS]
[-matchprintf FORMATSTRING] [-nomatchprintf FORMATSTRING]
[-bufsize BUFSIZE] [-container_bufsize CONTAINER_BUFSIZE]
[-filename FILENAME] [-useformats INCLUDEPUIDS]
[-nouseformats EXCLUDEPUIDS] [-matchprintf FORMATSTRING]
[-nomatchprintf FORMATSTRING] [-bufsize BUFSIZE]
[-container_bufsize CONTAINER_BUFSIZE]
[-loadformats XML1,...,XMLn] [-confdir CONFDIR]
[FILE [FILE ...]]

Format Identification for Digital Objects (fido). FIDO is a command-line tool
to identify the file formats of digital objects. It is designed for simple
integration into automated work-flows.
Format Identification for Digital Objects (fido).
FIDO is a command-line tool to identify the file formats of digital objects.

It is designed for simple integration into automated work-flows.


positional arguments:
FILE files to check. If the file is -, then read content
from stdin. In this case, python must be invoked with
-u or it may convert the line terminators.
FILE files to check. If the file is -, then read content from
stdin. In this case, python must be invoked with -u or it may convert the line
terminators.

optional arguments:
-h, --help show this help message and exit
-v show version information
-q run (more) quietly
-recurse recurse into subdirectories
-zip recurse into zip and tar files
-nocontainer disable deep scan of container documents, increases
speed but may reduce accuracy with big files
-input INPUT file containing a list of files to check, one per
line. - means stdin
-nocontainer disable deep scan of container documents, increases spee
d but may reduce accuracy with big files
-input INPUT file containing a list of files to check, one per line.
- means stdin
-filename FILENAME filename if file contents passed through STDIN
-useformats INCLUDEPUIDS
comma separated string of formats to use in
identification
comma separated string of formats to use in identificati
on
-nouseformats EXCLUDEPUIDS
comma separated string of formats not to use in
identification
comma separated string of formats not to use in identifi
cation
-matchprintf FORMATSTRING
format string (Python style) to use on match. See
nomatchprintf, README.txt.
format string (Python style) to use on match. See nomatc
hprintf, README.txt.
-nomatchprintf FORMATSTRING
format string (Python style) to use if no match. See
README.txt
-bufsize BUFSIZE size (in bytes) of the buffer to match against
(default=131072 bytes)
format string (Python style) to use if no match. See REA
DME.txt
-bufsize BUFSIZE size (in bytes) of the buffer to match against (default=
131072 bytes)
-container_bufsize CONTAINER_BUFSIZE
size (in bytes) of the buffer to match against
(default=524288 bytes)
size (in bytes) of the buffer to match against (default=
524288 bytes)
-loadformats XML1,...,XMLn
comma separated string of XML format files to add.
-confdir CONFDIR configuration directory to load_fido_xml, for example,
the format specifications from.

Open Planets Foundation (http://www.openplanetsfoundation.org)
See License.txt for license information.
Download from: http://github.com/openplanets/fido/downloads
Author: Adam Farquhar, 2010
Maintainer: Maurice de Rooij (OPF/NANETH), 2011, 2012
FIDO uses the UK National Archives (TNA) PRONOM File Format and Container descriptions.
PRONOM is available from http://www.nationalarchives.gov.uk/pronom/
-confdir CONFDIR configuration directory to load_fido_xml, for example, t
he format specifications from.

Open Planets Foundation (http://www.openplanetsfoundation.org)
See License.txt for license information.
Download from: https://github.com/openplanets/fido/releases
Usage guide: http://wiki.opf-labs.org/display/TR/FIDO+usage+guide
Author: Adam Farquhar (BL), 2010
Maintainer: Maurice de Rooij (OPF/NANETH), 2011, 2012, 2013
FIDO uses the UK National Archives (TNA) PRONOM File Format
and Container descriptions.
PRONOM is available from http://www.nationalarchives.gov.uk/pronom/

Installation
------------

(also see: http://wiki.opf-labs.org/display/TR/FIDO+usage+guide)

Any platform
1. Download the latest zip release from http://github.com/openplanets/fido/downloads
(or use the big Downloads button on http://github.com/openplanets/fido)
1. Download the latest zip release from https://github.com/openplanets/fido/releases
2. Unzip into some directory
3. Open a command shell, cd to the directory that you placed the zip contents into and cd into folder 'fido'
4. You should now be able to see the help text:
Expand Down Expand Up @@ -116,7 +123,7 @@ The defaults for FIDO 1.0 are:
It can be useful to provide an empty string for either, for example to ignore all failed matches, or all successful ones (see examples below).
Note that a newline needs to be added to the end of the string using \n.

Matchttypes
Matchtypes
-----------

FIDO returns the following matchtypes:
Expand Down
24 changes: 12 additions & 12 deletions fido/fido.py
Expand Up @@ -6,7 +6,7 @@
from xml.etree import ElementTree as CET
from xml.etree import ElementTree as VET # versions.xml

version = '1.1.9'
version = '1.1.91'
defaults = {'bufsize': 128 * 1024, # (bytes)
'regexcachesize' : 2084, # (bytes)
'conf_dir' : os.path.join(os.path.dirname(__file__), 'conf'),
Expand All @@ -25,17 +25,17 @@
'epilog' : """
Open Planets Foundation (http://www.openplanetsfoundation.org)
See License.txt for license information.
Download from: http://github.com/openplanets/fido/downloads\n
Author: Adam Farquhar, 2010
Maintainer: Maurice de Rooij (OPF/NANETH), 2011, 2012
FIDO uses the UK National Archives (TNA) PRONOM File Format and Container descriptions.
PRONOM is available from http://www.nationalarchives.gov.uk/pronom/.
"""
Download from: https://github.com/openplanets/fido/releases
Usage guide: http://wiki.opf-labs.org/display/TR/FIDO+usage+guide
Author: Adam Farquhar (BL), 2010
Maintainer: Maurice de Rooij (OPF/NANETH), 2011, 2012, 2013
FIDO uses the UK National Archives (TNA) PRONOM File Format
and Container descriptions.
PRONOM is available from http://www.nationalarchives.gov.uk/pronom/"""
}

class Fido:
def __init__(self, quiet=False, bufsize=None, container_bufsize = None, printnomatch=None, printmatch=None,
zip=False, nocontainer=False, handle_matches=None, conf_dir=None, format_files=None, containersignature_file=None):
def __init__(self, quiet=False, bufsize=None, container_bufsize = None, printnomatch=None, printmatch=None, zip=False, nocontainer=False, handle_matches=None, conf_dir=None, format_files=None, containersignature_file=None):
global defaults
self.quiet = quiet
self.bufsize = (defaults['bufsize'] if bufsize == None else bufsize)
Expand Down Expand Up @@ -734,20 +734,20 @@ def list_files(roots, recurse=False):
def main(arglist=None):
# The argparse package was introduced in 2.7
t0 = time.clock()
from argparselocal import ArgumentParser
from argparselocal import ArgumentParser, RawTextHelpFormatter
if arglist == None:
arglist = sys.argv[1:]
if len(arglist) == False:
arglist.append("-h")
parser = ArgumentParser(description=defaults['description'], epilog=defaults['epilog'], fromfile_prefix_chars='@')
parser = ArgumentParser(description=defaults['description'], epilog=defaults['epilog'], fromfile_prefix_chars='@', formatter_class=RawTextHelpFormatter)
parser.add_argument('-v', default=False, action='store_true', help='show version information')
parser.add_argument('-q', default=False, action='store_true', help='run (more) quietly')
parser.add_argument('-recurse', default=False, action='store_true', help='recurse into subdirectories')
parser.add_argument('-zip', default=False, action='store_true', help='recurse into zip and tar files')
parser.add_argument('-nocontainer', default=False, action='store_true', help='disable deep scan of container documents, increases speed but may reduce accuracy with big files')
group = parser.add_mutually_exclusive_group()
group.add_argument('-input', default=False, help='file containing a list of files to check, one per line. - means stdin')
group.add_argument('files', nargs='*', default=[], metavar='FILE', help='files to check. If the file is -, then read content from stdin. In this case, python must be invoked with -u or it may convert the line terminators.')
group.add_argument('files', nargs='*', default=[], metavar='FILE', help='files to check. If the file is -, then read content from stdin. In this case, python must be invoked with -u or it may convert the line terminators.')
parser.add_argument('-filename', default=None, help='filename if file contents passed through STDIN')
parser.add_argument('-useformats', metavar='INCLUDEPUIDS', default=None, help='comma separated string of formats to use in identification')
parser.add_argument('-nouseformats', metavar='EXCLUDEPUIDS', default=None, help='comma separated string of formats not to use in identification')
Expand Down
2 changes: 1 addition & 1 deletion fido/update_signatures.py
Expand Up @@ -5,7 +5,7 @@
#
# Open Planets Foundation (http://www.openplanetsfoundation.org)
# See License.txt for license information.
# Download from: http://github.com/openplanets/fido/downloads
# Download from: https://github.com/openplanets/fido/releases
# Author: Maurice de Rooij (NANETH), 2012
#
# FIDO uses the UK National Archives (TNA) PRONOM File Format and Container descriptions .
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -7,7 +7,7 @@
extra['use_2to3'] = True

setup( name='fido',
version='1.1.1',
version='1.1.91',
install_requires=['distribute'],
description='Format Identification for Digital Objects (FIDO)',
packages=['fido'],
Expand Down

0 comments on commit c7a4925

Please sign in to comment.