1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Remove debug traces and fix the solver dlg.

This commit is contained in:
Shlomi Fish 2017-06-03 03:38:25 +03:00
parent aa4f9ee5da
commit f40fdfbb82
5 changed files with 11 additions and 10 deletions

View file

@ -524,7 +524,6 @@ class Application:
id_, random = self.nextgame.id, self.nextgame.random id_, random = self.nextgame.id, self.nextgame.random
self.nextgame.id, self.nextgame.random = 0, None self.nextgame.id, self.nextgame.random = 0, None
try: try:
print("fopako id_", id_)
self.runGame(id_, random) self.runGame(id_, random)
except Exception: except Exception:
# try Klondike if current game fails # try Klondike if current game fails

View file

@ -1149,7 +1149,6 @@ class ConfigObj(Section):
``ConfigObj(infile=None, options=None, **kwargs)`` ``ConfigObj(infile=None, options=None, **kwargs)``
""" """
print('pink infile = ',infile)
if infile is None: if infile is None:
infile = [] infile = []
if options is None: if options is None:
@ -1237,7 +1236,6 @@ class ConfigObj(Section):
' file like object, or list of lines.') ' file like object, or list of lines.')
# #
if infile: if infile:
print('infile flyt = ',infile)
# don't do it for the empty ConfigObj # don't do it for the empty ConfigObj
infile = self._handle_bom(infile) infile = self._handle_bom(infile)
# infile is now *always* a list # infile is now *always* a list
@ -1439,7 +1437,6 @@ class ConfigObj(Section):
def _parse(self, infile): def _parse(self, infile):
"""Actually parse the config file.""" """Actually parse the config file."""
print('aolk', infile)
temp_list_values = self.list_values temp_list_values = self.list_values
if self.unrepr: if self.unrepr:
self.list_values = False self.list_values = False

View file

@ -27,12 +27,16 @@ import os
import time import time
import subprocess import subprocess
import re import re
import sys
# PySol imports # PySol imports
from pysollib.settings import DEBUG, FCS_COMMAND from pysollib.settings import DEBUG, FCS_COMMAND
from pysollib.mfxutil import destruct from pysollib.mfxutil import destruct
from pysollib.util import KING from pysollib.util import KING
if sys.version_info > (3,):
unicode = str
# ************************************************************************ # ************************************************************************
# * HintInterface is an abstract class that defines the public # * HintInterface is an abstract class that defines the public
# * interface - it only consists of the constructor # * interface - it only consists of the constructor
@ -884,7 +888,10 @@ class FreeCellSolver_Hint(Base_Solver_Hint):
kw['close_fds'] = True kw['close_fds'] = True
p = subprocess.Popen(command, **kw) p = subprocess.Popen(command, **kw)
pin, pout, perr = p.stdin, p.stdout, p.stderr pin, pout, perr = p.stdin, p.stdout, p.stderr
pin.write(bytes(board, 'utf-8')) bytes_board = board
if sys.version_info > (3,):
bytes_board = bytes(board, 'utf-8')
pin.write(bytes_board)
pin.close() pin.close()
# #
stack_types = { stack_types = {
@ -901,7 +908,7 @@ class FreeCellSolver_Hint(Base_Solver_Hint):
states = 0 states = 0
for sbytes in pout: for sbytes in pout:
s = str(sbytes, encoding='utf-8') s = unicode(sbytes, encoding='utf-8')
if DEBUG >= 5: if DEBUG >= 5:
print(s) print(s)
@ -922,7 +929,7 @@ class FreeCellSolver_Hint(Base_Solver_Hint):
hints = [] hints = []
for sbytes in pout: for sbytes in pout:
s = str(sbytes, encoding='utf-8') s = unicode(sbytes, encoding='utf-8')
if DEBUG: if DEBUG:
print(s) print(s)
if self._determineIfSolverState(s): if self._determineIfSolverState(s):

View file

@ -564,12 +564,10 @@ class Options:
# create ConfigObj instance # create ConfigObj instance
try: try:
print(filename)
config = configobj.ConfigObj(filename, config = configobj.ConfigObj(filename,
configspec=configspec, configspec=configspec,
encoding=self._config_encoding) encoding=self._config_encoding)
except configobj.ParseError: except configobj.ParseError:
raise BaseException('foo')
traceback.print_exc() traceback.print_exc()
config = configobj.ConfigObj(configspec=configspec, config = configobj.ConfigObj(configspec=configspec,
encoding=self._config_encoding) encoding=self._config_encoding)

View file

@ -79,5 +79,5 @@ SELECT_GAME_MENU = True
TRANSLATE_GAME_NAMES = True TRANSLATE_GAME_NAMES = True
# debug # debug
DEBUG = 121 # must be integer DEBUG = 0 # must be integer
CHECK_GAMES = False # check duplicated names and classes CHECK_GAMES = False # check duplicated names and classes