|
16 | 16 | # Copyright (C) 2008-2010 Yaacov Zamir <kzamir_a_walla.co.il>, |
17 | 17 | # Meir kriheli <[email protected]> |
18 | 18 | "bidirectional alogrithm implementation" |
| 19 | +import sys |
19 | 20 |
|
20 | | -from unicodedata import bidirectional, mirrored |
21 | 21 | import inspect |
22 | | -import sys |
23 | 22 | from collections import deque |
24 | | -from mirror import MIRRORED |
| 23 | +from unicodedata import bidirectional, mirrored |
| 24 | +import six |
| 25 | + |
| 26 | +from .mirror import MIRRORED |
| 27 | + |
25 | 28 |
|
26 | 29 | # Some definitions |
27 | 30 | PARAGRAPH_LEVELS = { 'L':0, 'AL':1, 'R': 1 } |
|
38 | 41 | } |
39 | 42 |
|
40 | 43 | # Added 'B' so X6 won't execute in that case and X8 will run it's course |
41 | | -X6_IGNORED = X2_X5_MAPPINGS.keys() + ['BN', 'PDF', 'B'] |
42 | | -X9_REMOVED = X2_X5_MAPPINGS.keys() + ['BN', 'PDF'] |
| 44 | +X6_IGNORED = list(X2_X5_MAPPINGS.keys()) + ['BN', 'PDF', 'B'] |
| 45 | +X9_REMOVED = list(X2_X5_MAPPINGS.keys()) + ['BN', 'PDF'] |
43 | 46 |
|
44 | 47 | _embedding_direction = lambda x:('L', 'R')[x % 2] |
45 | 48 |
|
@@ -597,7 +600,7 @@ def get_display(unicode_or_str, encoding='utf-8', upper_is_rtl=False, |
597 | 600 | storage = get_empty_storage() |
598 | 601 |
|
599 | 602 | # utf-8 ? we need unicode |
600 | | - if isinstance(unicode_or_str, unicode): |
| 603 | + if isinstance(unicode_or_str, six.string_types): |
601 | 604 | text = unicode_or_str |
602 | 605 | decoded = False |
603 | 606 | else: |
|
0 commit comments