documentation & helper script

pull/1/head
Castro0o 5 years ago
parent 9652ec2a2f
commit 3f1645dbc4

@ -78,3 +78,9 @@ Each of the saved documents:
* resulting in `static_html/index.html`
# Bulk image upload upload_imgs_dir.py
Get Help: `python upload_imgs_dir.py --help`
**Edit and run via** `.helper-upload_imgs_dir.sh`

@ -0,0 +1,21 @@
#!/bin/sh
python3 upload_imgs_dir.py \
--title 'Ang Bayan December 1984' \
--creator 'Central Committee of the Communist Party of the Philippines' \
--date '1984/12/01' \
--org 'Communist Party of the Philippines' \
--format 'Bulletin' \
--topic 'Communism, Armed Struggle' \
--dir '/full/path/to/2020_bantayog/Folder name' \
# --dry
# Note:
# * Add this values to you upload specific upload.
# * --dry can be enabled to show you what will be uploaded and the metadata, without actully uploading it
# * parameters --event --topic can be added
# * \ allow you to continue the command of a different line
#
# Get help: python3 upload_imgs_dir.py --help

@ -16,31 +16,26 @@ p.add_argument('--dry', '-d', action='store_true',
help='dry-run: will only print the metadata of each file that '
'will be upload, but does NOT upload')
p.add_argument('--dir', required=True,
help='Full path of the image directory, that you wish to upload')
help='Required. Full path of the image directory, that you wish to upload')
p.add_argument('--title', required=True,
help='Metadata **Title** value of publication. Must not exist yet'
' in the wiki.')
help='Required. Must not exist yet in the wiki.')
p.add_argument('--date', required=True,
help='Metadata **Date** value of publication. Format yyyy/mm/dd '
'For dates without day or mont use 01 as default '
help='Required. Format: yyyy/mm/dd '
'For dates without day or month use 01 as default '
'ie. 1986: --date "1986/01/01" '
'March 1985: --date "1984/05/01"')
p.add_argument('--creator', required=False, action='append', default=[''],
help='Metadata **Creator** value(s) of publication. Multiple '
'values should be SEPARATED BY COMMA')
p.add_argument('--organization', required=False, action='append', default=[''],
help='Metadata **Organization** value(s) of publication. '
'Multiple values should be SEPARATED BY COMMA')
help='Multiple values should be SEPARATED BY COMMA')
p.add_argument('--org', required=False, action='append', default=[''],
help='Organization:Multiple values should be SEPARATED BY '
'COMMA')
p.add_argument('--format', required=False, action='append', default=[''],
help='Metadata **Format** value(s) of publication. '
'Multiple values should be SEPARATED BY COMMA')
help='Multiple values should be SEPARATED BY COMMA')
p.add_argument('--event', required=False, action='append', default=[''],
help='Metadata **Event** value(s) of publication. '
'Multiple values should be SEPARATED BY COMMA')
help='Multiple values should be SEPARATED BY COMMA')
p.add_argument('--topic', required=False, action='append', default=[''],
help='Metadata **Topic** value(s) of publication. '
'Multiple values should be SEPARATED BY COMMA')
help='Multiple values should be SEPARATED BY COMMA')
# TODO ADD NEW PROPS
args = p.parse_args()
@ -91,7 +86,7 @@ for n, _file in enumerate(lsimgs):
part=n + 1,
partof=len(lsimgs),
creator=(', ').join(args.creator[1:]),
organization=(', ').join(args.organization[1:]),
organization=(', ').join(args.org[1:]),
format=(', ').join(args.format[1:]),
event=(', ').join(args.event[1:]),
topic=(', ').join(args.topic[1:])
@ -113,4 +108,6 @@ for n, _file in enumerate(lsimgs):
level='fail')
print(f'See image at {pageurl}')
else:
print(img_smw_prop_val)

Loading…
Cancel
Save