Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and nijel committed Mar 13, 2024
1 parent 0794aa2 commit 9346db5
Show file tree
Hide file tree
Showing 82 changed files with 32 additions and 120 deletions.
4 changes: 2 additions & 2 deletions tests/translate/convert/test_php2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def test_convertphpempty(self):

def test_unicode(self):
"""Checks that unicode entries convert properly."""
unistring = "Norsk bokm\u00E5l"
unistring = "Norsk bokm\u00e5l"
phpsource = """$lang['nb'] = '%s';""" % unistring
pofile = self.php2po(phpsource)
pounit = self.singleelement(pofile)
print(repr(pofile.units[0].target))
print(repr(pounit.source))
assert pounit.source == "Norsk bokm\u00E5l"
assert pounit.source == "Norsk bokm\u00e5l"

def test_multiline(self):
"""Checks that multiline enties can be parsed."""
Expand Down
2 changes: 1 addition & 1 deletion tests/translate/convert/test_prop2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_unicode(self):
pounit = self.singleelement(pofile)
print(repr(pofile.units[0].target))
print(repr(pounit.source))
assert pounit.source == "Norsk bokm\u00E5l"
assert pounit.source == "Norsk bokm\u00e5l"

def test_multiline_escaping(self):
"""Checks that multiline enties can be parsed."""
Expand Down
1 change: 0 additions & 1 deletion tests/translate/storage/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

"""tests for storage base classes."""


import os
from io import BytesIO

Expand Down
1 change: 0 additions & 1 deletion translate/convert/accesskey.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

"""functions used to manipulate access keys in strings."""


from translate.storage.placeables.general import XMLEntityPlaceable

DEFAULT_ACCESSKEY_MARKER = "&"
Expand Down
5 changes: 1 addition & 4 deletions translate/convert/ical2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ def convert_store(self):

def merge_stores(self):
"""Convert two source format files to a target format file."""
self.extraction_msg = "extracted from {}, {}".format(
self.template_store.filename,
self.source_store.filename,
)
self.extraction_msg = f"extracted from {self.template_store.filename}, {self.source_store.filename}"

self.source_store.makeindex()
for template_unit in self.template_store.units:
Expand Down
5 changes: 1 addition & 4 deletions translate/convert/ini2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ def convert_store(self):

def merge_stores(self):
"""Convert two source format files to a target format file."""
self.extraction_msg = "extracted from {}, {}".format(
self.template_store.filename,
self.source_store.filename,
)
self.extraction_msg = f"extracted from {self.template_store.filename}, {self.source_store.filename}"

self.source_store.makeindex()
for template_unit in self.template_store.units:
Expand Down
5 changes: 1 addition & 4 deletions translate/convert/php2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ def convert_store(self):

def merge_stores(self):
"""Convert two source format files to a target format file."""
self.extraction_msg = "extracted from {}, {}".format(
self.template_store.filename,
self.source_store.filename,
)
self.extraction_msg = f"extracted from {self.template_store.filename}, {self.source_store.filename}"

self.source_store.makeindex()
for template_unit in self.template_store.units:
Expand Down
12 changes: 2 additions & 10 deletions translate/convert/po2prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,9 @@ def convertline(self, line):
self.inecho = False
assert isinstance(value, str)
returnline = "%(key)s%(del)s%(value)s%(term)s%(eol)s" % {
"key": "{}{}{}".format(
self.personality.key_wrap_char,
key,
self.personality.key_wrap_char,
),
"key": f"{self.personality.key_wrap_char}{key}{self.personality.key_wrap_char}",
"del": delimiter if delimiter_pos != -1 or value else "",
"value": "{}{}{}".format(
self.personality.value_wrap_char,
self.personality.encode(value),
self.personality.value_wrap_char,
),
"value": f"{self.personality.value_wrap_char}{self.personality.encode(value)}{self.personality.value_wrap_char}",
"term": self.personality.pair_terminator,
"eol": eol,
}
Expand Down
1 change: 0 additions & 1 deletion translate/convert/po2symb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
for examples and usage instructions.
"""


from translate.convert import convert
from translate.storage import factory
from translate.storage.pypo import po_escape_map
Expand Down
1 change: 0 additions & 1 deletion translate/convert/pot2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
for examples and usage instructions.
"""


from translate.misc.multistring import multistring
from translate.search import match
from translate.storage import catkeys, factory, poheader
Expand Down
5 changes: 1 addition & 4 deletions translate/convert/yaml2po.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ def convert_store(self):

def merge_stores(self):
"""Convert two source format files to a target format file."""
self.extraction_msg = "extracted from {}, {}".format(
self.template_store.filename,
self.source_store.filename,
)
self.extraction_msg = f"extracted from {self.template_store.filename}, {self.source_store.filename}"

self.source_store.makeindex()
for template_unit in self.template_store.units:
Expand Down
1 change: 0 additions & 1 deletion translate/lang/af.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Afrikaans_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/ak.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Akan_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/am.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Amharic_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/ar.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Arabic_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/az.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Azerbaijani_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/bn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Bengali_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/bo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Standard_Tibetan`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/code_as.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Assamese_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/code_or.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Odia_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
- phrases
"""


import logging
import re

Expand Down
1 change: 0 additions & 1 deletion translate/lang/da.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Danish_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`German_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/dz.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Dzongkha_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/el.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Greek_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
it could also be used for Asturian, Galician, or Catalan.
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/fa.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Persian_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/fi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

"""This module represents the Finnish language."""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`French_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/gd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Gaelic_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/gu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Gujarati_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/he.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Hebrew_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/hi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Hindi_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/hy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Armenian_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/ja.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Japanese_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/km.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Khmer_language`
"""


import re

from translate.lang import common
Expand Down
1 change: 0 additions & 1 deletion translate/lang/kn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Kannada_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/ko.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Korean_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/kw.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Cornish_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/lo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Lao_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Malayalam_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/mr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Marathi_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/ms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Malay_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/my.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Burmese_language`
"""


from translate.lang import common


Expand Down
1 change: 0 additions & 1 deletion translate/lang/ne.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
.. seealso:: :wp:`Nepali_language`
"""


import re

from translate.lang import common
Expand Down

0 comments on commit 9346db5

Please sign in to comment.