mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +00:00
build(metaUpdater): Handle Non-Existant Files
If .zenodo.json (or codemeta.json) isn't there, only throw a warning, and continue.
This commit is contained in:
parent
8086a04fb3
commit
69e82ca60c
|
@ -11,6 +11,9 @@ from collections import OrderedDict
|
||||||
|
|
||||||
|
|
||||||
class Manipulator(object):
|
class Manipulator(object):
|
||||||
|
def __str__(self):
|
||||||
|
return self.__class__.__name__
|
||||||
|
|
||||||
def load(self, filename):
|
def load(self, filename):
|
||||||
with open(filename, 'rb') as fp:
|
with open(filename, 'rb') as fp:
|
||||||
self.data = json.load(fp, object_pairs_hook=OrderedDict)
|
self.data = json.load(fp, object_pairs_hook=OrderedDict)
|
||||||
|
@ -150,7 +153,11 @@ def main():
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
for manipulator in (CodeMetaManipulator(), ZenodoManipulator()):
|
for manipulator in (CodeMetaManipulator(), ZenodoManipulator()):
|
||||||
manipulator.load()
|
try:
|
||||||
|
manipulator.load()
|
||||||
|
except FileNotFoundError as e:
|
||||||
|
print('*** Skipping {}: {}'.format(manipulator, e))
|
||||||
|
continue
|
||||||
if args.newversion is not None:
|
if args.newversion is not None:
|
||||||
manipulator.version(args.newversion)
|
manipulator.version(args.newversion)
|
||||||
manipulator.update_authors()
|
manipulator.update_authors()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user