Skip to content

Commit

Permalink
RRFS_dev2: sync with dev1 (#52)
Browse files Browse the repository at this point in the history
Sync with dev1 branch
  • Loading branch information
hu5970 authored Jul 10, 2021
1 parent b9df364 commit 80cfc81
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions log_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,15 @@ def isdate(string):
def isdomain(string):

''' Returns a bool after checking whether the input string meets the
requirements for a date string: YYYYMMDDHH. '''

return string.lower() in [d.lower() for d in DOMAINS]
requirements for a domain, or list of domains '''

string_list = [i.strip("[]\"', ") for i in string.split(',')]
domains = [d.lower() for d in DOMAINS]
for s in string_list:
if s.lower() not in domains:
print(f'{s} is not a valid domain')
return False
return True

def load_externals(ext_path="Externals.cfg"):

Expand Down Expand Up @@ -230,7 +236,7 @@ def logit(logfile, tmpfile):
# Create a logfile backup just in case. Make it a hidden file.
# Won't remove this one in the script in case something goes
# wrong.
path, fname = os.path.abspath(logfile), os.path.basename(logfile)
path, fname = os.path.dirname(logfile), os.path.basename(logfile)
shutil.copy(logfile, os.path.join(path, f".{fname}._bk"))

# Write the contents of the logfile to the tempfile for reverse
Expand Down

0 comments on commit 80cfc81

Please sign in to comment.