raw strings fix
This commit is contained in:
parent
d49e0d0c17
commit
eec0c342d8
|
|
@ -157,7 +157,7 @@ def setup_table(table='requests'):
|
|||
for L in open('cache/request_table.txt','r').readlines():
|
||||
L = L.strip()
|
||||
#print(L)
|
||||
(col,type) = re.split("\s\s\s\s",L)
|
||||
(col,type) = re.split(r"\s\s\s\s",L)
|
||||
if not first:
|
||||
q += ",\n"
|
||||
first = 0
|
||||
|
|
@ -1159,13 +1159,13 @@ def guess_dept(t):
|
|||
method = 2 # xlisted takes dept first listed
|
||||
|
||||
if method==1:
|
||||
p = "^([A-Z/]+)\d+"
|
||||
p = r"^([A-Z/]+)\d+"
|
||||
m = re.search(p, t['code'])
|
||||
if m:
|
||||
return m.group(1)
|
||||
return '?'
|
||||
if method==2:
|
||||
p = "^([A-Z]+)[\d/]+"
|
||||
p = r"^([A-Z]+)[\d/]+"
|
||||
m = re.search(p, t['code'])
|
||||
if m:
|
||||
return m.group(1)
|
||||
|
|
@ -1700,7 +1700,7 @@ ORDER BY u.sortablename;"""
|
|||
|
||||
def build_db_schedule():
|
||||
# from the schedule json files
|
||||
target = "\_sched\_expanded\.json"
|
||||
target = r"\_sched\_expanded\.json"
|
||||
def finder(st):
|
||||
return re.search(target,st)
|
||||
|
||||
|
|
@ -2132,4 +2132,3 @@ if __name__ == "__main__":
|
|||
# Call the function in the options dict
|
||||
options[ int(resp)][1]()
|
||||
|
||||
|
||||
|
|
|
|||
34
server.py
34
server.py
|
|
@ -201,20 +201,20 @@ def homepage():
|
|||
a('want to shut down?','/sd') + "<br />" + \
|
||||
a('', '') + br
|
||||
|
||||
def orgline(L):
|
||||
L.strip()
|
||||
if re.search("^\s*$", L): return ""
|
||||
|
||||
a = re.search( '^\*\s(.*)$', L)
|
||||
if a: return "<h2>%s</h2>\n" % a.group(1)
|
||||
|
||||
b = re.search( 'TODO\s\[\#A\](.*)$', L)
|
||||
if b: return "<b><i>Todo - Priority 1</i>: %s</b>" % b.group(1) + br + nl
|
||||
|
||||
d = re.search( '^\*\*\*\s(.*)$', L)
|
||||
if d: return d.group(1)
|
||||
d = re.search( '^\*\*\s(.*)$', L)
|
||||
if d: L = d.group(1)
|
||||
def orgline(L):
|
||||
L.strip()
|
||||
if re.search(r"^\s*$", L): return ""
|
||||
|
||||
a = re.search( r'^\*\s(.*)$', L)
|
||||
if a: return "<h2>%s</h2>\n" % a.group(1)
|
||||
|
||||
b = re.search( r'TODO\s\[\#A\](.*)$', L)
|
||||
if b: return "<b><i>Todo - Priority 1</i>: %s</b>" % b.group(1) + br + nl
|
||||
|
||||
d = re.search( r'^\*\*\*\s(.*)$', L)
|
||||
if d: return d.group(1)
|
||||
d = re.search( r'^\*\*\s(.*)$', L)
|
||||
if d: L = d.group(1)
|
||||
|
||||
return L + br + nl
|
||||
|
||||
|
|
@ -450,7 +450,7 @@ def lectures():
|
|||
#print(f)
|
||||
with tag('item'):
|
||||
name = f.split('.')[0]
|
||||
ff = re.sub('\s','%20',f)
|
||||
ff = re.sub(r'\s','%20',f)
|
||||
with tag('title'): text(name)
|
||||
with tag('guid'): text(f)
|
||||
b = os.path.getsize(LECPATH+f)
|
||||
|
|
@ -520,8 +520,8 @@ def staff_dir(search=''):
|
|||
######
|
||||
|
||||
|
||||
def find_goo(n):
|
||||
g = re.search('00(\d\d\d\d\d\d)', n)
|
||||
def find_goo(n):
|
||||
g = re.search(r'00(\d{6})', n)
|
||||
|
||||
if g:
|
||||
return g.groups()[0]
|
||||
|
|
|
|||
Loading…
Reference in New Issue