Skip to content

Commit

Permalink
po/xml2po use r with re variable and noqa to remove noise from Flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Twol committed Oct 5, 2023
1 parent ae6b113 commit 2328f40
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions po/xml2po.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import six

import sys
Expand All @@ -23,7 +22,7 @@ def __init__(self, attrlist):
self.isPointsElement, self.isReboundsElement = 0, 0
self.attrlist = attrlist
self.last_comment = None
self.ishex = re.compile('#[0-9a-fA-F]+\Z')
self.ishex = re.compile(r'#[0-9a-fA-F]+\Z')

def comment(self, comment):
if "TRANSLATORS:" in comment:
Expand Down Expand Up @@ -65,7 +64,7 @@ def startElement(self, name, attrs):
print('#: ' + arg)
k.replace("\\n", "\"\n\"")
if c:
for l in c.split('\n'):
for l in c.split('\n'): # noqa: E741
print("#. ", l)
print('msgid "' + six.ensure_str(k) + '"')
print('msgstr ""')
Expand Down

0 comments on commit 2328f40

Please sign in to comment.