Download:
child 351:b9cb3f7b1623
parent 349:1e4dbced3e4d
350:dcb1b9786835
Anton Shestakov <av6@dwimlabs.net>, Mon, 13 Apr 2020 00:25:26 +0800
incoming: make all regular expressions raw strings

1 файлов изменено, 10 вставок(+), 10 удалений(-) [+]
incoming.py file | annotate | diff | comparison | revisions
--- a/incoming.py Mon Apr 13 00:11:33 2020 +0800
+++ b/incoming.py Mon Apr 13 00:25:26 2020 +0800
@@ -109,17 +109,17 @@
rest = line[len(meta_prefix):]
- m = re.match('^task: (\w+)$', rest)
+ m = re.match(r'^task: (\w+)$', rest)
if m is not None:
state = m.group(1)
item['cls'] = 'task'
- m = re.match('^job failed', rest)
+ m = re.match(r'^job failed', rest)
if m is not None:
success = False
item['cls'] = 'failure'
- m = re.match('^job (started|finished): ([\dT:+-]+)$', rest)
+ m = re.match(r'^job (started|finished): ([\dT:+-]+)$', rest)
if m is not None:
if m.group(1) == 'started':
started = parse_timestamp(m.group(2))
@@ -127,32 +127,32 @@
finished = parse_timestamp(m.group(2))
state = None
- m = re.match('^project URL: (\S+)$', rest)
+ m = re.match(r'^project URL: (\S+)$', rest)
if m is not None:
url = m.group(1)
- m = re.match('^commit: (?:(\d+):)?(\w+)$', rest)
+ m = re.match(r'^commit: (?:(\d+):)?(\w+)$', rest)
if m is not None:
rev = m.group(1)
node = m.group(2)
- m = re.match('^commit branch: (.+)$', rest)
+ m = re.match(r'^commit branch: (.+)$', rest)
if m is not None:
branch = m.group(1)
- m = re.match('^commit ref names:.* HEAD -> (\S+)(, |$)', rest)
+ m = re.match(r'^commit ref names:.* HEAD -> (\S+)(, |$)', rest)
if m is not None:
branch = m.group(1)
- m = re.match('^commit date: (.+)$', rest)
+ m = re.match(r'^commit date: (.+)$', rest)
if m is not None:
date = m.group(1)
- m = re.match('^commit author: (.+)$', rest)
+ m = re.match(r'^commit author: (.+)$', rest)
if m is not None:
author = m.group(1)
- m = re.match('^commit message: (.+)$', rest)
+ m = re.match(r'^commit message: (.+)$', rest)
if m is not None:
message = m.group(1)