sys.exit(0)
clean_opts = dict()
- clean_opts['publisher'] = options['--publisher']
+ clean_opts['publisher'] = append_period(options['--publisher'])
+
clean_opts['consortium'] = options['--consortium']
clean_opts['authorization'] = options['--authorization']
clean_opts['note'] = options['--note']
if '--platform' in options:
- clean_opts['platform'] = options['--platform']
+ clean_opts['platform'] = append_period(options['--platform'])
clean_opts['libraries'] = _libraries
clean_opts['input'] = _input
return clean_opts
+def append_period(text):
+ """
+ Append a period to the incoming text if required
+ """
+
+ if text[-1] != '.':
+ text += '.'
+
+ return text
+
def check_libraries(options):
"""Build a dict of the libraries that were requested for this batch"""
"""
publisher = options['publisher']
+
munge_publisher = False
need_publisher = True
need_relator = True
# Iterate through all of the existing 710 fields
for sten in record.get_fields('710'):
for pub in sten.get_subfields('a'):
- if pub == publisher or (pub == publisher + '.'):
+ if pub == publisher:
munge_publisher = True
for rel in sten.get_subfields('4'):
if rel == 'pbl':
sten.add_subfield('4', 'pbl')
need_publisher = False
- # Append a period to the publisher name
- if publisher[-1] != '.':
- publisher += '.'
-
if need_publisher:
# Add the publisher, with relator code
seven_ten = pymarc.Field(tag = '710',
if pub == platform or (pub == platform + '.'):
need_platform = False
- # Append a period to the publisher name
- if platform[-1] != '.':
- platform += '.'
-
if need_platform:
# Add the platform
seven_ten = pymarc.Field(tag = '710',