mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
flake 8
This commit is contained in:
parent
99ef711af1
commit
d77ef531ad
2 changed files with 61 additions and 60 deletions
|
@ -22,7 +22,8 @@
|
|||
# ---------------------------------------------------------------------------##
|
||||
|
||||
# imports
|
||||
import sys, os
|
||||
import sys
|
||||
import os
|
||||
import traceback
|
||||
|
||||
# PySol imports
|
||||
|
@ -34,7 +35,10 @@ import pysollib.settings
|
|||
# Toolkit imports
|
||||
from pysollib.pysoltk import TOOLBAR_BUTTONS
|
||||
|
||||
from pysollib.mygettext import _, n_
|
||||
from pysollib.mygettext import _
|
||||
|
||||
if sys.version_info > (3,):
|
||||
unicode = str
|
||||
|
||||
# ************************************************************************
|
||||
# * Options
|
||||
|
@ -284,7 +288,7 @@ class Options:
|
|||
self.tile_theme = 'default'
|
||||
self.default_tile_theme = 'default'
|
||||
self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, lef, right
|
||||
##self.toolbar_style = 'default'
|
||||
# self.toolbar_style = 'default'
|
||||
self.toolbar_style = 'bluecurve'
|
||||
self.toolbar_relief = 'flat'
|
||||
self.toolbar_compound = 'none' # icons only
|
||||
|
@ -373,7 +377,8 @@ class Options:
|
|||
self.game_holded = 0 # gameid or 0
|
||||
self.wm_maximized = 0
|
||||
self.save_games_geometry = False
|
||||
self.games_geometry = {} # saved games geometry (gameid: (width, height))
|
||||
# saved games geometry (gameid: (width, height))
|
||||
self.games_geometry = {}
|
||||
self.game_geometry = (0, 0) # game geometry before exit
|
||||
self.offsets = {} # cards offsets
|
||||
#
|
||||
|
@ -453,7 +458,7 @@ class Options:
|
|||
CSI.TYPE_TAROCK: ("Vienna 2K", ""),
|
||||
CSI.TYPE_HEXADECK: ("Hex A Deck", ""),
|
||||
CSI.TYPE_MUGHAL_GANJIFA: ("Mughal Ganjifa", ""),
|
||||
##CSI.TYPE_NAVAGRAHA_GANJIFA: ("Navagraha Ganjifa", ""),
|
||||
# CSI.TYPE_NAVAGRAHA_GANJIFA: ("Navagraha Ganjifa", ""),
|
||||
CSI.TYPE_NAVAGRAHA_GANJIFA: ("Dashavatara Ganjifa", ""),
|
||||
CSI.TYPE_DASHAVATARA_GANJIFA: ("Dashavatara Ganjifa", ""),
|
||||
CSI.TYPE_TRUMP_ONLY: ("Matrix", ""),
|
||||
|
@ -527,8 +532,7 @@ class Options:
|
|||
config['offsets'][key] = val
|
||||
|
||||
config.write()
|
||||
##config.write(sys.stdout); print
|
||||
|
||||
# config.write(sys.stdout); print
|
||||
|
||||
def _getOption(self, section, key, t):
|
||||
config = self._config
|
||||
|
@ -591,7 +595,7 @@ class Options:
|
|||
# validation
|
||||
vdt = validate.Validator()
|
||||
res = config.validate(vdt)
|
||||
##from pprint import pprint; pprint(res)
|
||||
# from pprint import pprint; pprint(res)
|
||||
if res is not True:
|
||||
for section, data in res.items():
|
||||
if data is True:
|
||||
|
@ -602,7 +606,6 @@ class Options:
|
|||
'section: "%s", key: "%s"' % (section, key))
|
||||
config[section][key] = None
|
||||
|
||||
|
||||
# general
|
||||
for key, t in self.GENERAL_OPTIONS:
|
||||
val = self._getOption('general', key, t)
|
||||
|
@ -711,5 +714,3 @@ class Options:
|
|||
self.offsets[key] = val
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use Test::Differences qw( eq_or_diff );
|
|||
use String::ShellQuote qw/ shell_quote /;
|
||||
|
||||
# my $cmd = shell_quote( 'flake8', '.' );
|
||||
my $cmd = shell_quote( 'flake8', glob('./pysollib/[a-m]*.py') );
|
||||
my $cmd = shell_quote( 'flake8', glob('./pysollib/[a-o]*.py') );
|
||||
|
||||
# TEST
|
||||
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );
|
||||
|
|
Loading…
Add table
Reference in a new issue