Skip to content

Commit a77e156

Browse files
authored
Merge pull request #17 from hossein-pourbozorg/hossein-pourbozorg-patch-1
use pylint
2 parents 77d200d + d27d861 commit a77e156

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

arabic_reshaper/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import os
2+
13
from .arabic_reshaper import reshape, default_reshaper, ArabicReshaper
24

3-
import os
45

56
exec(open(os.path.join(os.path.dirname(__file__), '__version__.py')).read())

arabic_reshaper/arabic_reshaper.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
# to a PDF generating method.
2424

2525
from __future__ import unicode_literals
26-
from builtins import range
2726

2827
import re
2928
import os
@@ -83,8 +82,8 @@ def __init__(self, configuration=None, configuration_file=None):
8382
raise Exception(
8483
('Default configuration file {} not found,' +
8584
' check the module installation.').format(
86-
configuration_files[0],
87-
)
85+
configuration_files[0],
86+
)
8887
)
8988

9089
loaded_from_envvar = False
@@ -110,7 +109,7 @@ def __init__(self, configuration=None, configuration_file=None):
110109
configuration_files.append(configuration_file)
111110

112111
configuration_parser = ConfigParser()
113-
configuration_from_files = configuration_parser.read(
112+
configuration_parser.read(
114113
configuration_files
115114
)
116115

@@ -151,7 +150,7 @@ def _ligatures_re(self):
151150

152151
def _get_ligature_forms_from_re_group_index(self, group_index):
153152
if not hasattr(self, '_re_group_index_to_ligature_forms'):
154-
self._ligatures_re
153+
return self._ligatures_re
155154
return self._re_group_index_to_ligature_forms[group_index]
156155

157156
def reshape(self, text):
@@ -176,9 +175,8 @@ def reshape(self, text):
176175

177176
positions_harakat = {}
178177

179-
isolated_form = (
180-
use_unshaped_instead_of_isolated and UNSHAPED or ISOLATED
181-
)
178+
isolated_form = (UNSHAPED
179+
if use_unshaped_instead_of_isolated else ISOLATED)
182180

183181
for letter in text:
184182
if HARAKAT_RE.match(letter):
@@ -207,7 +205,7 @@ def reshape(self, text):
207205
elif not connects_with_letter_before(letter):
208206
output.append((letter, isolated_form))
209207
elif not connects_with_letter_after(
210-
previous_letter[LETTER]
208+
previous_letter[LETTER]
211209
):
212210
output.append((letter, isolated_form))
213211
elif (previous_letter[FORM] == FINAL and not

0 commit comments

Comments
 (0)