diff --git a/pysollib/app.py b/pysollib/app.py index ccd0ae32..a630476d 100644 --- a/pysollib/app.py +++ b/pysollib/app.py @@ -524,7 +524,6 @@ class Application: id_, random = self.nextgame.id, self.nextgame.random self.nextgame.id, self.nextgame.random = 0, None try: - print("fopako id_", id_) self.runGame(id_, random) except Exception: # try Klondike if current game fails diff --git a/pysollib/configobj/configobj.py b/pysollib/configobj/configobj.py index dbef477d..9fa96caa 100644 --- a/pysollib/configobj/configobj.py +++ b/pysollib/configobj/configobj.py @@ -1149,7 +1149,6 @@ class ConfigObj(Section): ``ConfigObj(infile=None, options=None, **kwargs)`` """ - print('pink infile = ',infile) if infile is None: infile = [] if options is None: @@ -1237,7 +1236,6 @@ class ConfigObj(Section): ' file like object, or list of lines.') # if infile: - print('infile flyt = ',infile) # don't do it for the empty ConfigObj infile = self._handle_bom(infile) # infile is now *always* a list @@ -1439,7 +1437,6 @@ class ConfigObj(Section): def _parse(self, infile): """Actually parse the config file.""" - print('aolk', infile) temp_list_values = self.list_values if self.unrepr: self.list_values = False diff --git a/pysollib/hint.py b/pysollib/hint.py index 4724dfb9..1563c4c8 100644 --- a/pysollib/hint.py +++ b/pysollib/hint.py @@ -27,12 +27,16 @@ import os import time import subprocess import re +import sys # PySol imports from pysollib.settings import DEBUG, FCS_COMMAND from pysollib.mfxutil import destruct from pysollib.util import KING +if sys.version_info > (3,): + unicode = str + # ************************************************************************ # * HintInterface is an abstract class that defines the public # * interface - it only consists of the constructor @@ -884,7 +888,10 @@ class FreeCellSolver_Hint(Base_Solver_Hint): kw['close_fds'] = True p = subprocess.Popen(command, **kw) 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() # stack_types = { @@ -901,7 +908,7 @@ class FreeCellSolver_Hint(Base_Solver_Hint): states = 0 for sbytes in pout: - s = str(sbytes, encoding='utf-8') + s = unicode(sbytes, encoding='utf-8') if DEBUG >= 5: print(s) @@ -922,7 +929,7 @@ class FreeCellSolver_Hint(Base_Solver_Hint): hints = [] for sbytes in pout: - s = str(sbytes, encoding='utf-8') + s = unicode(sbytes, encoding='utf-8') if DEBUG: print(s) if self._determineIfSolverState(s): diff --git a/pysollib/options.py b/pysollib/options.py index 2b78b950..50225a74 100644 --- a/pysollib/options.py +++ b/pysollib/options.py @@ -564,12 +564,10 @@ class Options: # create ConfigObj instance try: - print(filename) config = configobj.ConfigObj(filename, configspec=configspec, encoding=self._config_encoding) except configobj.ParseError: - raise BaseException('foo') traceback.print_exc() config = configobj.ConfigObj(configspec=configspec, encoding=self._config_encoding) diff --git a/pysollib/settings.py b/pysollib/settings.py index 31749e0c..43ee9bdd 100644 --- a/pysollib/settings.py +++ b/pysollib/settings.py @@ -79,5 +79,5 @@ SELECT_GAME_MENU = True TRANSLATE_GAME_NAMES = True # debug -DEBUG = 121 # must be integer +DEBUG = 0 # must be integer CHECK_GAMES = False # check duplicated names and classes