1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-22 03:04:09 -04:00

Passed mfxutil thru flake8.

See https://github.com/shlomif/PySolFC/issues/61#issuecomment-374283730
- thanks!
This commit is contained in:
Shlomi Fish 2018-03-19 19:11:00 +02:00
parent a68546f7a2
commit 74d3a4d9db
2 changed files with 18 additions and 18 deletions

View file

@ -38,17 +38,17 @@ Image = ImageTk = ImageOps = None
if TOOLKIT == 'tk': if TOOLKIT == 'tk':
try: # PIL try: # PIL
from PIL import Image from PIL import Image
from PIL import ImageTk from PIL import ImageTk # noqa: F401
from PIL import ImageOps from PIL import ImageOps # noqa: F401
except ImportError: except ImportError:
Image = None Image = None
else: else:
# for py2exe # for py2exe
from PIL import GifImagePlugin from PIL import GifImagePlugin # noqa: F401
from PIL import PngImagePlugin from PIL import PngImagePlugin # noqa: F401
from PIL import JpegImagePlugin from PIL import JpegImagePlugin # noqa: F401
from PIL import BmpImagePlugin from PIL import BmpImagePlugin # noqa: F401
from PIL import PpmImagePlugin from PIL import PpmImagePlugin # noqa: F401
Image._initialized = 2 Image._initialized = 2
USE_PIL = False USE_PIL = False
if TOOLKIT == 'tk' and Image and Image.VERSION >= '1.1.7': if TOOLKIT == 'tk' and Image and Image.VERSION >= '1.1.7':
@ -81,11 +81,11 @@ def latin1_to_ascii(n):
n = n.encode('iso8859-1', 'replace') n = n.encode('iso8859-1', 'replace')
# FIXME: rewrite this for better speed # FIXME: rewrite this for better speed
return (n.replace("\xc4", "Ae") return (n.replace("\xc4", "Ae")
.replace("\xd6", "Oe") .replace("\xd6", "Oe")
.replace("\xdc", "Ue") .replace("\xdc", "Ue")
.replace("\xe4", "ae") .replace("\xe4", "ae")
.replace("\xf6", "oe") .replace("\xf6", "oe")
.replace("\xfc", "ue")) .replace("\xfc", "ue"))
def latin1_normalize(n): def latin1_normalize(n):
@ -131,10 +131,10 @@ def getusername():
def getprefdir(package): def getprefdir(package):
if (TOOLKIT == 'kivy'): if (TOOLKIT == 'kivy'):
from pysollib.kivy.LApp import get_platform from pysollib.kivy.LApp import get_platform
plat = get_platform() plat = get_platform()
if plat == 'android': if plat == 'android':
os.environ['HOME'] = '/sdcard' os.environ['HOME'] = '/sdcard'
if os.name == "nt": if os.name == "nt":
return win32_getprefdir(package) return win32_getprefdir(package)
@ -184,7 +184,8 @@ def win32_getprefdir(package):
# ************************************************************************ # ************************************************************************
def destruct(obj): def destruct(obj):
if TOOLKIT=='kivy': return if TOOLKIT == 'kivy':
return
# assist in breaking circular references # assist in breaking circular references
if obj is not None: if obj is not None:

View file

@ -26,7 +26,6 @@ my %skip = (
pysollib/games/mahjongg/__init__.py pysollib/games/mahjongg/__init__.py
pysollib/games/special/__init__.py pysollib/games/special/__init__.py
pysollib/games/ultra/__init__.py pysollib/games/ultra/__init__.py
pysollib/mfxutil.py
pysollib/pysoltk.py pysollib/pysoltk.py
pysollib/tile/ttk.py pysollib/tile/ttk.py
pysollib/ui/tktile/Canvas2.py pysollib/ui/tktile/Canvas2.py