diff --git a/pyproject.toml b/pyproject.toml index d16617e..e32fb68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rda_python_dsupdt" -version = "2.0.1" +version = "2.0.2" authors = [ { name="Zaihua Ji", email="zji@ucar.edu" }, ] diff --git a/src/rda_python_dsupdt/dsupdt.py b/src/rda_python_dsupdt/dsupdt.py index c24e47e..817fb84 100644 --- a/src/rda_python_dsupdt/dsupdt.py +++ b/src/rda_python_dsupdt/dsupdt.py @@ -18,8 +18,9 @@ import re from os import path as op from .pg_updt import PgUpdt +from rda_python_common.pg_split import PgSplit -class DsUpdt(PgUpdt): +class DsUpdt(PgUpdt, PgSplit): def __init__(self): super().__init__() # initialize parent class self.TEMPINFO = {} @@ -1333,7 +1334,7 @@ def archive_data_file(self, lfile, locrec, tempinfo, eidx): if tempinfo['gotnew'] and not re.search(r'(^|\s)-OE(\s|$)', options, re.I): acmd += " -OE" if 'VS' in self.params: acmd += " -VS {}".format(self.params['VS']) - if 'VS' in tempinfo: options = re.sub('-VS\s+\d+(\s+|$)', '', options, flags=re.I) + if 'VS' in tempinfo: options = re.sub(r'-VS\s+\d+(\s+|$)', '', options, flags=re.I) if tempinfo['RS'] == 1: acmd += " -RS" fnote = None if locrec['note'] and not re.search(r'(^|\s)-DE(\s|$)', options, re.I): @@ -1705,7 +1706,7 @@ def build_data_note(self, onote, lfile, locrec, tempinfo): return onote if pcnt == 2: # replace start time if onote: # get start time from existing note - replace = "{}{}{}".format(seps[0], patterns[0], seps[1]) + replace = r"{}{}{}".format(seps[0], patterns[0], seps[1]) ms = re.match(r'^(.*){}(.*){}'.format(replace, self.params['PD'][0]), note) if ms: init = ms.group(1) diff --git a/src/rda_python_dsupdt/pg_updt.py b/src/rda_python_dsupdt/pg_updt.py index 189ac42..4669bad 100644 --- a/src/rda_python_dsupdt/pg_updt.py +++ b/src/rda_python_dsupdt/pg_updt.py @@ -1071,7 +1071,7 @@ def check_server_file(self, dcmd, opt, cfile): ms = re.match(r'^(-\w+)', buf) while ms: flg = ms.group(1) - buf = re.sub('^-\w+\s+'.format(flg), '', buf, 1) # remove options + buf = re.sub(r'^-\w+\s+'.format(flg), '', buf, 1) # remove options if flg != "-r": # no option value m = re.match(r'^(\S+)\s', buf) if not m: break