Tiny code style corrections
This commit is contained in:
parent
16cd926e36
commit
36a3db5e29
|
@ -29,14 +29,18 @@ import defs
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
||||||
def paragraph_direction_mark(text):
|
def paragraph_direction_mark(text):
|
||||||
"""Determine paragraph writing direction according to
|
"""
|
||||||
|
Determine paragraph writing direction according to
|
||||||
http://www.unicode.org/reports/tr9/#The_Paragraph_Level
|
http://www.unicode.org/reports/tr9/#The_Paragraph_Level
|
||||||
|
|
||||||
Returns either Unicode LTR mark or RTL mark."""
|
Returns either Unicode LTR mark or RTL mark.
|
||||||
for c in text:
|
"""
|
||||||
bidi = unicodedata.bidirectional(c)
|
for char in text:
|
||||||
if bidi == 'L': return u'\u200E'
|
bidi = unicodedata.bidirectional(char)
|
||||||
elif bidi == 'AL' or bidi == 'R': return u'\u200F'
|
if bidi == 'L':
|
||||||
|
return u'\u200E'
|
||||||
|
elif bidi == 'AL' or bidi == 'R':
|
||||||
|
return u'\u200F'
|
||||||
|
|
||||||
return u'\u200E'
|
return u'\u200E'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue