Skip to content

Commit f096b6f

Browse files
committed
Fix parameter ordering in string generator
1 parent e7217db commit f096b6f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@
4040
include_package_data=True,
4141
install_requires=[
4242
"pillow>=7.0.0",
43-
"numpy>=1.17.3",
4443
"requests>=2.20.0",
4544
"opencv-python>=4.2.0.32",
4645
"tqdm>=4.23.0",
4746
"beautifulsoup4>=4.6.0",
4847
"diffimg==0.2.3",
48+
"arabic-reshaper==2.1.3",
49+
"python-bidi==0.4.2",
4950
],
5051
entry_points={
5152
"console_scripts": [

trdg/generators/from_strings.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

3-
from ..data_generator import FakeTextDataGenerator
4-
from ..utils import load_dict, load_fonts
3+
from trdg.data_generator import FakeTextDataGenerator
4+
from trdg.utils import load_dict, load_fonts
55

66
# support RTL
77
from arabic_reshaper import ArabicReshaper
@@ -16,7 +16,6 @@ def __init__(
1616
count=-1,
1717
fonts=[],
1818
language="en",
19-
rtl=False,
2019
size=32,
2120
skewing_angle=0,
2221
random_skew=False,
@@ -43,6 +42,7 @@ def __init__(
4342
stroke_fill="#282828",
4443
image_mode="RGB",
4544
output_bboxes=0,
45+
rtl=False,
4646
):
4747
self.count = count
4848
self.strings = strings
@@ -138,4 +138,7 @@ def reshape_rtl(self, strings: list, rtl_shaper: ArabicReshaper):
138138
rtl_strings.append(get_display(reshaped_string))
139139
return rtl_strings
140140

141-
141+
if __name__ == '__main__':
142+
from trdg.generators.from_wikipedia import GeneratorFromWikipedia
143+
s = GeneratorFromWikipedia("test")
144+
next(s)

0 commit comments

Comments
 (0)