opex-manifest-generator 1.2.4__py3-none-any.whl → 1.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opex_manifest_generator/__init__.py +15 -15
- opex_manifest_generator/cli.py +225 -194
- opex_manifest_generator/common.py +79 -79
- opex_manifest_generator/hash.py +63 -64
- opex_manifest_generator/metadata/EAD Template.xml +101 -101
- opex_manifest_generator/metadata/GDPR Template.xml +8 -8
- opex_manifest_generator/metadata/MODS Template.xml +66 -66
- opex_manifest_generator/opex_manifest.py +171 -98
- opex_manifest_generator/options/options.properties +22 -0
- {opex_manifest_generator-1.2.4.dist-info → opex_manifest_generator-1.3.1.dist-info}/METADATA +555 -527
- opex_manifest_generator-1.3.1.dist-info/RECORD +16 -0
- {opex_manifest_generator-1.2.4.dist-info → opex_manifest_generator-1.3.1.dist-info}/WHEEL +1 -1
- {opex_manifest_generator-1.2.4.dist-info → opex_manifest_generator-1.3.1.dist-info}/licenses/LICENSE.md +201 -201
- opex_manifest_generator/options.properties +0 -13
- opex_manifest_generator-1.2.4.dist-info/RECORD +0 -16
- {opex_manifest_generator-1.2.4.dist-info → opex_manifest_generator-1.3.1.dist-info}/entry_points.txt +0 -0
- {opex_manifest_generator-1.2.4.dist-info → opex_manifest_generator-1.3.1.dist-info}/top_level.txt +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"""
|
|
2
|
-
opex_manifest_generator package definitions
|
|
3
|
-
|
|
4
|
-
Author: Christopher Prince
|
|
5
|
-
license: Apache License 2.0"
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from .opex_manifest import OpexManifestGenerator,OpexDir,OpexFile
|
|
9
|
-
from .hash import HashGenerator
|
|
10
|
-
from .common import *
|
|
11
|
-
from .cli import parse_args,run_cli
|
|
12
|
-
import importlib.metadata
|
|
13
|
-
|
|
14
|
-
__author__ = "Christopher Prince (c.pj.prince@gmail.com)"
|
|
15
|
-
__license__ = "Apache License Version 2.0"
|
|
1
|
+
"""
|
|
2
|
+
opex_manifest_generator package definitions
|
|
3
|
+
|
|
4
|
+
Author: Christopher Prince
|
|
5
|
+
license: Apache License 2.0"
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .opex_manifest import OpexManifestGenerator,OpexDir,OpexFile
|
|
9
|
+
from .hash import HashGenerator
|
|
10
|
+
from .common import *
|
|
11
|
+
from .cli import parse_args,run_cli
|
|
12
|
+
import importlib.metadata
|
|
13
|
+
|
|
14
|
+
__author__ = "Christopher Prince (c.pj.prince@gmail.com)"
|
|
15
|
+
__license__ = "Apache License Version 2.0"
|
|
16
16
|
__version__ = importlib.metadata.version("opex_manifest_generator")
|
opex_manifest_generator/cli.py
CHANGED
|
@@ -1,195 +1,226 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Cli interaction.
|
|
3
|
-
|
|
4
|
-
author: Christopher Prince
|
|
5
|
-
license: Apache License 2.0"
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import argparse, os, inspect, time
|
|
9
|
-
from opex_manifest_generator.opex_manifest import OpexManifestGenerator
|
|
10
|
-
import importlib.metadata
|
|
11
|
-
|
|
12
|
-
def parse_args():
|
|
13
|
-
parser = argparse.ArgumentParser(description = "OPEX Manifest Generator for Preservica Uploads")
|
|
14
|
-
parser.add_argument('root', default = os.getcwd(),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
""
|
|
29
|
-
parser.add_argument("-
|
|
30
|
-
help= "
|
|
31
|
-
|
|
32
|
-
""
|
|
33
|
-
parser.add_argument("-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
parser.add_argument("-
|
|
39
|
-
help
|
|
40
|
-
parser.add_argument("-
|
|
41
|
-
help
|
|
42
|
-
parser.add_argument("--disable-meta-dir", required = False, action = 'store_false',
|
|
43
|
-
help = """Set whether to disable the creation of a 'meta' directory for generated files,
|
|
44
|
-
default behaviour is to always generate this directory""")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
parser.add_argument("-
|
|
49
|
-
help="
|
|
50
|
-
parser.add_argument("-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
help="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
parser.add_argument("-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
help="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
parser.add_argument("
|
|
75
|
-
help="
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
parser.add_argument("
|
|
79
|
-
|
|
80
|
-
parser.add_argument("--
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
1
|
+
"""
|
|
2
|
+
Cli interaction.
|
|
3
|
+
|
|
4
|
+
author: Christopher Prince
|
|
5
|
+
license: Apache License 2.0"
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import argparse, os, inspect, time
|
|
9
|
+
from opex_manifest_generator.opex_manifest import OpexManifestGenerator
|
|
10
|
+
import importlib.metadata
|
|
11
|
+
|
|
12
|
+
def parse_args():
|
|
13
|
+
parser = argparse.ArgumentParser(description = "OPEX Manifest Generator for Preservica Uploads")
|
|
14
|
+
parser.add_argument('root', nargs='?', default = os.getcwd(),
|
|
15
|
+
help = """The root path to generate Opexes for, will recursively traverse all sub-directories.
|
|
16
|
+
Generates an Opex for each folder & (depending on options) file in the directory tree.""")
|
|
17
|
+
|
|
18
|
+
parser.add_argument("-fx", "--fixity", required = False, nargs = '*', default = None,
|
|
19
|
+
choices = ['SHA-1', 'MD5', 'SHA-256', 'SHA-512', 'SHA1', 'SHA256', 'SHA512'], type = str.upper, action=EmptyIsTrueFixity,
|
|
20
|
+
help="Generates a hash for each file and adds it to the opex, can select one or more algorithms to utilise. -fx SHA-1 MD5")
|
|
21
|
+
parser.add_argument("--pax-fixity", required = False, action = 'store_true', default = False,
|
|
22
|
+
help="""Enables use of PAX fixity generation, in line with Preservica's Recommendation.
|
|
23
|
+
"Files / folders ending in .pax or .pax.zip will have individual files in folder / zip added to Opex.""")
|
|
24
|
+
parser.add_argument("--fixity-export", required = False, action = 'store_false', default = True,
|
|
25
|
+
help="""Set whether to export the generated fixity list to a text file in the meta directory.
|
|
26
|
+
Enabled by default, disable with this flag.""")
|
|
27
|
+
parser.add_argument("-z", "--zip", required = False, action = 'store_true',
|
|
28
|
+
help="Set to zip files")
|
|
29
|
+
parser.add_argument("--remove-empty", required = False, action = 'store_true', default = False,
|
|
30
|
+
help = "Remove and log empty directories from root. Log will be exported to 'meta' / output folder.")
|
|
31
|
+
parser.add_argument("--hidden", required = False, action = 'store_true', default = False,
|
|
32
|
+
help="Set whether to include hidden files and folders")
|
|
33
|
+
parser.add_argument("-o", "--output", required = False, nargs = 1,
|
|
34
|
+
help = "Sets the output to send any generated files (Remove Empty, Fixity List, Autoref Export) to. Will not affect creation of a meta dir.")
|
|
35
|
+
parser.add_argument("-clr", "--clear-opex", required = False, action = 'store_true', default = False,
|
|
36
|
+
help = """Clears existing opex files from a directory. If set with no further options will only clear opexes;
|
|
37
|
+
if multiple options are set will clear opexes and then run the program""")
|
|
38
|
+
parser.add_argument("-opt","--options-file", required = False, default=os.path.join(os.path.dirname(__file__),'options','options.properties'),
|
|
39
|
+
help="Specify a custom Options file, changing the set presets for column headers (Title,Description,etc)")
|
|
40
|
+
parser.add_argument("--autoref-options", required = False, default = None,
|
|
41
|
+
help="Specify a custom Auto Reference Options file, changing the set presets for Auto Reference Generator")
|
|
42
|
+
parser.add_argument("--disable-meta-dir", required = False, action = 'store_false',
|
|
43
|
+
help = """Set whether to disable the creation of a 'meta' directory for generated files,
|
|
44
|
+
default behaviour is to always generate this directory""")
|
|
45
|
+
# Input Options
|
|
46
|
+
parser.add_argument("-i", "--input", required = False, nargs='?',
|
|
47
|
+
help="Set to utilise a CSV / XLSX spreadsheet to import data from")
|
|
48
|
+
parser.add_argument("-rm", "--remove", required = False, action = "store_true", default = False,
|
|
49
|
+
help="Set whether to enable removals of files and folders from a directory. ***Currently in testing")
|
|
50
|
+
parser.add_argument("-mdir","--metadata-dir", required=False, nargs= '?',
|
|
51
|
+
default = os.path.join(os.path.dirname(os.path.realpath(__file__)), "metadata"),
|
|
52
|
+
help="Specify the metadata directory to pull XML files from")
|
|
53
|
+
parser.add_argument("-m", "--metadata", required = False, const = 'e', default = 'none',
|
|
54
|
+
nargs = '?', choices = ['none', 'n', 'exact', 'e', 'flat', 'f'], type = str.lower,
|
|
55
|
+
help="Set whether to include xml metadata fields in the generation of the Opex")
|
|
56
|
+
parser.add_argument("--print-xmls", required = False, action = "store_true", default = False,
|
|
57
|
+
help="Prints the elements from your xmls to the consoles")
|
|
58
|
+
|
|
59
|
+
# Auto Reference Options
|
|
60
|
+
parser.add_argument("-r", "--autoref", required = False,
|
|
61
|
+
choices = ['catalog', 'c', 'accession', 'a', 'both', 'b', 'generic', 'g', 'catalog-generic', 'cg', "accession-generic", "ag", "both-generic", "bg"],
|
|
62
|
+
type = str.lower,
|
|
63
|
+
help="""Toggles whether to utilise the auto_reference_generator
|
|
64
|
+
to generate an on the fly Reference listing.
|
|
65
|
+
|
|
66
|
+
There are several options, {catalog} will generate
|
|
67
|
+
a Archival Reference following an ISAD(G) structure.
|
|
68
|
+
{accession} will create a running number of files.
|
|
69
|
+
{both} will do both at the same time!
|
|
70
|
+
{generic} will populate the title and description fields with the folder/file's name,
|
|
71
|
+
if used in conjunction with one of the above options:
|
|
72
|
+
{generic-catalog,generic-accession, generic-both} it will do both simultaneously.
|
|
73
|
+
""")
|
|
74
|
+
parser.add_argument("-p", "--prefix", required = False, nargs = '+',
|
|
75
|
+
help= """Assign a prefix when utilising the --autoref option. Prefix will append any text before all generated text.
|
|
76
|
+
When utilising the {both} option fill in like: [catalog-prefix, accession-prefix] without square brackets.
|
|
77
|
+
""")
|
|
78
|
+
parser.add_argument("-s", "--suffix", required = False, nargs = '?', default = '',
|
|
79
|
+
help= "Assign a suffix when utilising the --autoref option. Suffix will append any text after all generated text.")
|
|
80
|
+
parser.add_argument("--suffix-option", required = False, choices= ['apply_to_files','apply_to_folders','apply_to_both'], default = 'apply_to_files',
|
|
81
|
+
help = "Set whether to apply the suffix to files, folders or both when utilising the --autoref option.")
|
|
82
|
+
parser.add_argument("--accession-mode", nargs = '?', required=False, const='file', default=None, choices=["file",'directory','both'],
|
|
83
|
+
help="""Set the mode when utilising the Accession option in autoref.
|
|
84
|
+
file - only adds on files, folder - only adds on folders, both - adds on files and folders""")
|
|
85
|
+
parser.add_argument("-str", "--start-ref", required = False, nargs = '?', default = 1,
|
|
86
|
+
help="Set a custom Starting reference for the Auto Reference Generator. The generated reference will")
|
|
87
|
+
parser.add_argument("-ex", "--export-autoref", required = False, action = 'store_true', default = False,
|
|
88
|
+
help="Set whether to export the generated references to an AutoRef spreadsheet")
|
|
89
|
+
parser.add_argument("-fmt", "--output-format", required = False, default = "xlsx", choices = ['xlsx', 'csv','json','ods','xml'],
|
|
90
|
+
help="Set whether to export AutoRef Spreadsheet to: xlsx, csv, json, ods or xml format")
|
|
91
|
+
parser.add_argument("-dlm", "--delimiter", required=False,nargs = '?', type = str, default = '/',
|
|
92
|
+
help="Set a custom delimiter for generated references, default is '/'")
|
|
93
|
+
parser.add_argument("-key","--keywords", nargs = '*', default = None,
|
|
94
|
+
help = "Set to replace reference numbers with given Keywords for folders (only Folders atm). Can be a list of keywords or a JSON file mapping folder names to keywords.")
|
|
95
|
+
parser.add_argument("-keym","--keywords-mode", nargs = '?', const = "initialise", choices = ['initialise','firstletters','from_json'], default = 'initialise',
|
|
96
|
+
help = "Set to alternate keyword mode: 'initialise' will use initials of words; 'firstletters' will use the first letters of the string; 'from_json' will use a JSON file mapping names to keywords")
|
|
97
|
+
parser.add_argument("--keywords-case-sensitivity", required = False, action = 'store_false', default = True,
|
|
98
|
+
help = "Set to change case keyword matching sensitivity. By default keyword matching is insensitive")
|
|
99
|
+
parser.add_argument("--keywords-retain-order", required = False, default = False, action = 'store_true',
|
|
100
|
+
help = "Set when using keywords to continue reference numbering. If not used keywords don't 'count' to reference numbering, e.g. if using initials 'Project Alpha' -> 'PA' then the next folder/file will still be '001' not '003'")
|
|
101
|
+
parser.add_argument("--keywords-abbreviation-number", required = False, nargs='+', default = None, type = int,
|
|
102
|
+
help = "Set to set the number of letters to abbreviate for 'firstletters' mode, does not impact 'initialise' mode.")
|
|
103
|
+
parser.add_argument("--sort-by", required=False, nargs = '?', default = 'folders_first', choices = ['folders_first','alphabetical'], type=str.lower,
|
|
104
|
+
help = "Set the sorting method, 'folders_first' sorts folders first then files alphabetically; 'alphabetically' sorts alphabetically (ignoring folder distinction)")
|
|
105
|
+
|
|
106
|
+
parser.add_argument("-v", "--version", action = 'version', version = '%(prog)s {version}'.format(version = importlib.metadata.version("opex_manifest_generator")))
|
|
107
|
+
|
|
108
|
+
args = parser.parse_args()
|
|
109
|
+
return args
|
|
110
|
+
|
|
111
|
+
def run_cli():
|
|
112
|
+
args = parse_args()
|
|
113
|
+
print(f"Running Opex Generation on: {args.root}")
|
|
114
|
+
if isinstance(args.root, str):
|
|
115
|
+
args.root = args.root.strip("\"").rstrip("\\")
|
|
116
|
+
if not args.output:
|
|
117
|
+
args.output = os.path.abspath(args.root)
|
|
118
|
+
print(f'Output path defaulting to root directory: {args.output}')
|
|
119
|
+
else:
|
|
120
|
+
args.output = os.path.abspath(args.output[0])
|
|
121
|
+
print(f'Output path set to: {args.output}')
|
|
122
|
+
if args.input and args.autoref:
|
|
123
|
+
print(f'Both Input and Auto ref options have been selected, please use only one...')
|
|
124
|
+
time.sleep(5); raise SystemExit()
|
|
125
|
+
if args.remove and not args.input:
|
|
126
|
+
print('Removal flag has been given without input, please ensure an input file is utilised when using this option.')
|
|
127
|
+
time.sleep(5); raise SystemExit()
|
|
128
|
+
if not args.metadata in {'none', 'n'} and not args.input:
|
|
129
|
+
print(f'Warning: Metadata Flag has been given without Input. Metadata won\'t be generated.')
|
|
130
|
+
time.sleep(5)
|
|
131
|
+
if args.print_xmls:
|
|
132
|
+
OpexManifestGenerator(root = args.root, metadata_dir=args.metadata_dir).print_descriptive_xmls()
|
|
133
|
+
acc_prefix = None
|
|
134
|
+
if args.autoref in {"accession", "a", "accession-generic", "ag", "both", "b", "both-generic", "bg"} and args.accession_mode is None:
|
|
135
|
+
args.accession_mode = "file"
|
|
136
|
+
if args.prefix:
|
|
137
|
+
if args.autoref in {"both", "b", "both-generic", "bg"}:
|
|
138
|
+
if len(args.prefix) < 2 or len(args.prefix) > 2:
|
|
139
|
+
print('"Both" option is selected, please pass only two prefixes: [-p CATALOG_PREFIX ACCESSION_PREFIX]');
|
|
140
|
+
time.sleep(3); raise SystemExit
|
|
141
|
+
for n, a in enumerate(args.prefix):
|
|
142
|
+
if n == 0:
|
|
143
|
+
args.prefix = str(a)
|
|
144
|
+
elif n == 1:
|
|
145
|
+
acc_prefix = str(a)
|
|
146
|
+
print(f"Prefixes are set as: \t Catalog: {args.prefix} \t Acc: {acc_prefix}")
|
|
147
|
+
elif args.autoref in {"accession", "a", "accession-generic", "ag"}:
|
|
148
|
+
for a in args.prefix:
|
|
149
|
+
acc_prefix = str(a)
|
|
150
|
+
print('Prefix is set as: ' + acc_prefix)
|
|
151
|
+
elif args.autoref in {"catalog", "c", "catalog-generic", "cg"}:
|
|
152
|
+
acc_prefix = None
|
|
153
|
+
for a in args.prefix:
|
|
154
|
+
args.prefix = str(a)
|
|
155
|
+
print('Prefix is set as: ' + args.prefix)
|
|
156
|
+
elif args.autoref in {"generic", "g"}:
|
|
157
|
+
pass
|
|
158
|
+
else:
|
|
159
|
+
print('''An invalid option has been selected, please select a valid option:
|
|
160
|
+
{c, catalog
|
|
161
|
+
a, accession
|
|
162
|
+
b, both
|
|
163
|
+
g, generic
|
|
164
|
+
cg, catalog-generic
|
|
165
|
+
ag, accession-generic
|
|
166
|
+
bg, both-generic}''')
|
|
167
|
+
time.sleep(3)
|
|
168
|
+
raise SystemExit
|
|
169
|
+
if args.fixity:
|
|
170
|
+
print(f'Fixity is activated, using {args.fixity} algorithm')
|
|
171
|
+
if args.sort_by:
|
|
172
|
+
if args.sort_by == "folders_first":
|
|
173
|
+
sort_key = lambda x: (os.path.isfile(x), str.casefold(x))
|
|
174
|
+
elif args.sort_by == "alphabetical":
|
|
175
|
+
sort_key = str.casefold
|
|
176
|
+
if args.remove:
|
|
177
|
+
print(inspect.cleandoc("""****
|
|
178
|
+
You have enabled the remove functionality of the program. This action will remove all files and folders listed for removal and any sub-files/sub-folders.
|
|
179
|
+
|
|
180
|
+
This process will permanently delete the selected items, with no way recover the items.
|
|
181
|
+
|
|
182
|
+
****"""))
|
|
183
|
+
time.sleep(2)
|
|
184
|
+
i = input(inspect.cleandoc("Please type Y if you wish to proceed, otherwise the program will close: "))
|
|
185
|
+
if not i.lower() == "y":
|
|
186
|
+
print("Closing program..."); time.sleep(3); raise SystemExit()
|
|
187
|
+
time.sleep(3)
|
|
188
|
+
OpexManifestGenerator(root = args.root,
|
|
189
|
+
output_path = args.output,
|
|
190
|
+
autoref_flag = args.autoref,
|
|
191
|
+
prefix = args.prefix,
|
|
192
|
+
accession_mode=args.accession_mode,
|
|
193
|
+
acc_prefix = acc_prefix,
|
|
194
|
+
empty_flag = args.remove_empty,
|
|
195
|
+
removal_flag = args.remove,
|
|
196
|
+
clear_opex_flag = args.clear_opex,
|
|
197
|
+
algorithm = args.fixity,
|
|
198
|
+
pax_fixity= args.pax_fixity,
|
|
199
|
+
fixity_export_flag = args.fixity_export,
|
|
200
|
+
start_ref = args.start_ref,
|
|
201
|
+
export_flag = args.export_autoref,
|
|
202
|
+
meta_dir_flag = args.disable_meta_dir,
|
|
203
|
+
metadata_flag = args.metadata,
|
|
204
|
+
metadata_dir = args.metadata_dir,
|
|
205
|
+
hidden_flag= args.hidden,
|
|
206
|
+
zip_flag = args.zip,
|
|
207
|
+
input = args.input,
|
|
208
|
+
output_format = args.output_format,
|
|
209
|
+
options_file=args.options_file,
|
|
210
|
+
keywords = args.keywords,
|
|
211
|
+
keywords_mode = args.keywords_mode,
|
|
212
|
+
keywords_retain_order = args.keywords_retain_order,
|
|
213
|
+
keywords_case_sensitive = args.keywords_case_sensitivity,
|
|
214
|
+
delimiter = args.delimiter,
|
|
215
|
+
keywords_abbreviation_number = args.keywords_abbreviation_number,
|
|
216
|
+
sort_key = sort_key,
|
|
217
|
+
).main()
|
|
218
|
+
|
|
219
|
+
class EmptyIsTrueFixity(argparse.Action):
|
|
220
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
|
221
|
+
if len(values) == 0:
|
|
222
|
+
values = ["SHA-1"]
|
|
223
|
+
setattr(namespace, self.dest, values)
|
|
224
|
+
|
|
225
|
+
if __name__ == "__main__":
|
|
195
226
|
run_cli()
|