From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/grss:master commit in: grs/
Date: Wed, 7 Oct 2015 08:31:36 +0000 (UTC) [thread overview]
Message-ID: <1444207029.56bfb6c2fbb15dbc1b9bd2b618a47cc82d5f9a6c.blueness@gentoo> (raw)
commit: 56bfb6c2fbb15dbc1b9bd2b618a47cc82d5f9a6c
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 7 08:37:09 2015 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Oct 7 08:37:09 2015 +0000
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=56bfb6c2
lint: use raw strings with regexes.
grs/Interpret.py | 6 +++---
grs/Kernel.py | 6 +++---
grs/Populate.py | 2 +-
grs/Rotator.py | 4 ++--
grs/WorldConf.py | 8 ++++----
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/grs/Interpret.py b/grs/Interpret.py
index fd36650..db5bdd4 100644
--- a/grs/Interpret.py
+++ b/grs/Interpret.py
@@ -162,14 +162,14 @@ class Interpret(Daemon):
line_number += 1
# Skip lines with initial # as comments.
- m = re.search('^(#).*$', l)
+ m = re.search(r'^(#).*$', l)
if m:
continue
# For a release run, execute every line of the build script.
# For an update run, exexute only lines with a leading +.
ignore_stamp = False
- m = re.search('^(\+)(.*)$', l)
+ m = re.search(r'^(\+)(.*)$', l)
if m:
# There is a leading +, so remove it and skip if doing an update run
ignore_stamp = self.update_run
@@ -187,7 +187,7 @@ class Interpret(Daemon):
# single 'verb', or a 'verb obj' pair. While restrictive,
# its good enough for now.
try:
- m = re.search('(\S+)\s+(\S+)', l)
+ m = re.search(r'(\S+)\s+(\S+)', l)
verb = m.group(1)
obj = m.group(2)
except AttributeError:
diff --git a/grs/Kernel.py b/grs/Kernel.py
index 559aa57..a8205ba 100644
--- a/grs/Kernel.py
+++ b/grs/Kernel.py
@@ -47,18 +47,18 @@ class Kernel():
# The version line looks like the following:
# Linux/x86 4.0.6-hardened-r2 Kernel Configuration
# The 2nd group contains the version.
- m = re.search('^#\s+(\S+)\s+(\S+).+$', version_line)
+ m = re.search(r'^#\s+(\S+)\s+(\S+).+$', version_line)
gentoo_version = m.group(2)
try:
# Either the verison is of the form '4.0.6-hardened-r2' with two -'s
- m = re.search('(\S+?)-(\S+?)-(\S+)', gentoo_version)
+ m = re.search(r'(\S+?)-(\S+?)-(\S+)', gentoo_version)
vanilla_version = m.group(1)
flavor = m.group(2)
revision = m.group(3)
pkg_name = flavor + '-sources-' + vanilla_version + '-' + revision
except AttributeError:
# Or the verison is of the form '4.0.6-hardened' with one -
- m = re.search('(\S+?)-(\S+)', gentoo_version)
+ m = re.search(r'(\S+?)-(\S+)', gentoo_version)
vanilla_version = m.group(1)
flavor = m.group(2)
pkg_name = flavor + '-sources-' + vanilla_version
diff --git a/grs/Populate.py b/grs/Populate.py
index a1822ee..3271cb7 100644
--- a/grs/Populate.py
+++ b/grs/Populate.py
@@ -64,7 +64,7 @@ class Populate():
cycled_files = {}
for dirpath, dirnames, filenames in os.walk(self.workdir):
for f in filenames:
- m = re.search('^(.+)\.CYCLE\.(\d+)', f)
+ m = re.search(r'^(.+)\.CYCLE\.(\d+)', f)
if m:
filename = m.group(1)
cycle_no = int(m.group(2))
diff --git a/grs/Rotator.py b/grs/Rotator.py
index a1282b2..9daf7d2 100644
--- a/grs/Rotator.py
+++ b/grs/Rotator.py
@@ -45,7 +45,7 @@ class Rotator():
objs = glob.glob('%s.*' % obj)
indexed_obj = {}
for o in objs:
- m = re.search('^.+\.(\d+)$', o)
+ m = re.search(r'^.+\.(\d+)$', o)
indexed_obj[int(m.group(1))] = o
count = list(indexed_obj.keys())
count.sort()
@@ -58,7 +58,7 @@ class Rotator():
except NotADirectoryError:
os.unlink(current_obj)
continue
- m = re.search('^(.+)\.\d+$', current_obj)
+ m = re.search(r'^(.+)\.\d+$', current_obj)
next_obj = '%s.%d' % (m.group(1), c+1)
shutil.move(current_obj, next_obj)
diff --git a/grs/WorldConf.py b/grs/WorldConf.py
index c5882bf..b55110f 100644
--- a/grs/WorldConf.py
+++ b/grs/WorldConf.py
@@ -53,7 +53,7 @@ class WorldConf():
config.read(CONST.WORLD_CONFIG)
for s in config.sections():
for (directory, value) in config[s].items():
- p_slot_atom = re.sub('[/:]', '_', s)
+ p_slot_atom = re.sub(r'[/:]', '_', s)
dpath = os.path.join(CONST.PORTAGE_CONFIGDIR, directory)
fpath = os.path.join(dpath, p_slot_atom)
os.makedirs(dpath, mode=0o755, exist_ok=True)
@@ -84,18 +84,18 @@ class WorldConf():
cpv = portdb.cp_list(p)[0]
slotvar = portdb.aux_get(cpv, ['SLOT'])[0]
try:
- m = re.search('(.+?)\/(.+)', slotvar)
+ m = re.search(r'(.+?)\/(.+)', slotvar)
slot = m.group(1)
except AttributeError:
slot = slotvar
- slot_atoms.append(re.sub('[/:]', '_', '%s:%s' % (p, slot)))
+ slot_atoms.append(re.sub(r'[/:]', '_', '%s:%s' % (p, slot)))
# Also let's get a list of all the possible canonical file names
config = configparser.RawConfigParser(delimiters=':', allow_no_value=True, comment_prefixes=None)
config.read(CONST.WORLD_CONFIG)
canon = []
for s in config.sections():
- p_slot_atom = re.sub('[/:]', '_', s)
+ p_slot_atom = re.sub(r'[/:]', '_', s)
canon.append(p_slot_atom)
# Walk through all files in /etc/portage and remove any files for uninstalled pkgs.
next reply other threads:[~2015-10-07 8:31 UTC|newest]
Thread overview: 139+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 8:31 Anthony G. Basile [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-20 2:22 [gentoo-commits] proj/grss:master commit in: grs/ Anthony G. Basile
2022-07-20 1:49 Anthony G. Basile
2022-07-19 20:22 Anthony G. Basile
2022-07-19 20:18 Anthony G. Basile
2022-07-18 21:13 Anthony G. Basile
2019-04-19 12:29 Anthony G. Basile
2018-11-18 19:09 Anthony G. Basile
2018-11-12 3:08 Anthony G. Basile
2018-11-11 23:57 Anthony G. Basile
2018-11-11 23:35 Anthony G. Basile
2018-11-11 23:16 Anthony G. Basile
2018-06-25 20:32 Anthony G. Basile
2018-04-14 14:53 Anthony G. Basile
2018-04-10 3:14 Anthony G. Basile
2018-02-20 2:27 Anthony G. Basile
2018-02-20 2:04 Anthony G. Basile
2018-02-18 22:38 Anthony G. Basile
2018-02-18 16:37 Anthony G. Basile
2018-02-06 11:57 Anthony G. Basile
2018-02-06 11:42 Anthony G. Basile
2018-02-06 11:33 Anthony G. Basile
2018-02-06 10:55 Anthony G. Basile
2018-01-28 12:31 Anthony G. Basile
2018-01-28 12:09 Anthony G. Basile
2018-01-15 1:31 Anthony G. Basile
2018-01-15 1:23 Anthony G. Basile
2018-01-14 18:22 Anthony G. Basile
2018-01-14 17:05 Anthony G. Basile
2018-01-14 15:02 Anthony G. Basile
2018-01-14 14:37 Anthony G. Basile
2018-01-14 14:07 Anthony G. Basile
2018-01-13 17:40 Anthony G. Basile
2018-01-10 21:02 Anthony G. Basile
2018-01-10 20:40 Anthony G. Basile
2017-12-28 17:54 Anthony G. Basile
2017-12-28 17:22 Anthony G. Basile
2017-12-27 9:25 Anthony G. Basile
2017-12-26 14:19 Anthony G. Basile
2017-12-26 0:04 Anthony G. Basile
2017-12-26 0:04 Anthony G. Basile
2017-12-26 0:04 Anthony G. Basile
2017-12-25 23:38 Anthony G. Basile
2017-12-25 23:24 Anthony G. Basile
2017-12-23 16:04 Anthony G. Basile
2017-12-23 14:15 Anthony G. Basile
2016-03-23 15:08 Anthony G. Basile
2016-03-23 15:05 Anthony G. Basile
2015-11-26 19:48 Anthony G. Basile
2015-10-10 20:20 Anthony G. Basile
2015-10-10 19:36 Anthony G. Basile
2015-10-10 19:07 Anthony G. Basile
2015-10-10 12:22 Anthony G. Basile
2015-10-10 11:44 Anthony G. Basile
2015-10-10 11:22 Anthony G. Basile
2015-10-10 11:20 Anthony G. Basile
2015-10-10 11:10 Anthony G. Basile
2015-10-10 1:46 Anthony G. Basile
2015-10-10 1:40 Anthony G. Basile
2015-10-10 1:34 Anthony G. Basile
2015-10-10 1:26 Anthony G. Basile
2015-10-10 1:23 Anthony G. Basile
2015-10-10 1:18 Anthony G. Basile
2015-10-10 0:34 Anthony G. Basile
2015-10-10 0:29 Anthony G. Basile
2015-10-09 23:33 Anthony G. Basile
2015-10-09 23:33 Anthony G. Basile
2015-10-09 23:30 Anthony G. Basile
2015-10-09 23:11 Anthony G. Basile
2015-10-09 23:06 Anthony G. Basile
2015-10-08 23:52 Anthony G. Basile
2015-10-08 18:03 Anthony G. Basile
2015-10-08 17:20 Anthony G. Basile
2015-10-07 11:28 Anthony G. Basile
2015-10-07 11:15 Anthony G. Basile
2015-10-07 11:07 Anthony G. Basile
2015-10-07 11:03 Anthony G. Basile
2015-10-07 10:57 Anthony G. Basile
2015-10-07 8:01 Anthony G. Basile
2015-10-06 10:07 Anthony G. Basile
2015-09-16 22:08 Anthony G. Basile
2015-09-16 5:16 Anthony G. Basile
2015-09-16 0:37 Anthony G. Basile
2015-09-16 0:32 Anthony G. Basile
2015-09-14 7:17 Anthony G. Basile
2015-09-14 5:32 Anthony G. Basile
2015-09-14 5:25 Anthony G. Basile
2015-09-14 0:29 Anthony G. Basile
2015-09-13 17:31 Anthony G. Basile
2015-09-12 20:56 Anthony G. Basile
2015-09-12 20:56 Anthony G. Basile
2015-08-09 20:26 Anthony G. Basile
2015-08-08 20:06 Anthony G. Basile
2015-08-08 18:01 Anthony G. Basile
2015-08-08 17:51 Anthony G. Basile
2015-07-29 0:20 Anthony G. Basile
2015-07-28 22:44 Anthony G. Basile
2015-07-27 20:49 Anthony G. Basile
2015-07-25 22:36 Anthony G. Basile
2015-07-14 23:37 Anthony G. Basile
2015-07-14 23:29 Anthony G. Basile
2015-07-14 23:19 Anthony G. Basile
2015-07-14 23:16 Anthony G. Basile
2015-07-14 23:02 Anthony G. Basile
2015-07-14 22:39 Anthony G. Basile
2015-07-14 22:35 Anthony G. Basile
2015-07-14 21:45 Anthony G. Basile
2015-07-14 21:21 Anthony G. Basile
2015-07-14 21:02 Anthony G. Basile
2015-07-14 20:55 Anthony G. Basile
2015-07-10 12:54 Anthony G. Basile
2015-07-10 2:37 Anthony G. Basile
2015-07-10 2:37 Anthony G. Basile
2015-07-10 2:01 Anthony G. Basile
2015-07-09 15:26 Anthony G. Basile
2015-07-09 1:44 Anthony G. Basile
2015-07-08 15:44 Anthony G. Basile
2015-07-08 10:28 Anthony G. Basile
2015-07-07 20:52 Anthony G. Basile
2015-07-07 20:34 Anthony G. Basile
2015-07-07 14:30 Anthony G. Basile
2015-07-07 12:54 Anthony G. Basile
2015-07-07 12:46 Anthony G. Basile
2015-07-07 12:44 Anthony G. Basile
2015-07-07 12:33 Anthony G. Basile
2015-07-07 11:26 Anthony G. Basile
2015-07-07 2:17 Anthony G. Basile
2015-07-06 20:13 Anthony G. Basile
2015-07-06 18:13 Anthony G. Basile
2015-07-05 16:49 Anthony G. Basile
2015-07-05 12:04 Anthony G. Basile
2015-07-02 22:30 Anthony G. Basile
2015-07-01 17:27 Anthony G. Basile
2015-07-01 17:03 Anthony G. Basile
2015-07-01 16:53 Anthony G. Basile
2015-07-01 16:52 Anthony G. Basile
2015-07-01 16:07 Anthony G. Basile
2015-07-01 12:30 Anthony G. Basile
2015-07-01 12:23 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444207029.56bfb6c2fbb15dbc1b9bd2b618a47cc82d5f9a6c.blueness@gentoo \
--to=blueness@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox