Skip to content

Commit

Permalink
fix global being overwritten #35, fix interactive when using py3k
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion committed Jan 4, 2018
1 parent 1998809 commit 15a3189
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xeHentai/cli.py
Expand Up @@ -197,7 +197,7 @@ def _readline(x, default = ""):
x = x % default x = x % default
_ = input(logger.safestr(x)) if PY3K else raw_input(logger.safestr(x)) _ = input(logger.safestr(x)) if PY3K else raw_input(logger.safestr(x))
_ = _ or default _ = _ or default
return _.decode(locale.getdefaultlocale()[1] or 'utf-8') return _ if PY3K else _.decode(locale.getdefaultlocale()[1] or 'utf-8')


if not xeH.has_login and _readline(i18n.PS_LOGIN) == 'y': if not xeH.has_login and _readline(i18n.PS_LOGIN) == 'y':
uname = pwd = "" uname = pwd = ""
Expand Down
5 changes: 3 additions & 2 deletions xeHentai/util/__init__.py
Expand Up @@ -16,6 +16,9 @@
else:# assume posix else:# assume posix
filename_filter = re.compile("[\/:]") filename_filter = re.compile("[\/:]")


if PY3K:
unichr = chr

def parse_cookie(coostr): def parse_cookie(coostr):
ret = {} ret = {}
for coo in coostr.split(";"): for coo in coostr.split(";"):
Expand Down Expand Up @@ -63,8 +66,6 @@ def parse_human_time(s):
return rt return rt


def htmlescape(s): def htmlescape(s):
if PY3K:
unichr = chr
def replc(match): def replc(match):
#print match.group(0),match.group(1),match.group(2) #print match.group(0),match.group(1),match.group(2)
dict={'amp':'&','nbsp':' ','quot':'"','lt':'<','gt':'>','copy':'©','reg':'®'} dict={'amp':'&','nbsp':' ','quot':'"','lt':'<','gt':'>','copy':'©','reg':'®'}
Expand Down

0 comments on commit 15a3189

Please sign in to comment.