summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-11 14:46:50 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 10:26:53 (GMT)
commitf0b6970680fc8298b0d63e44e96d542cbd575096 (patch)
treed890c108ced7e8a71c961353030768df417f74a3
parent71e0f56531d8c2904569e1392640d912e1571bf4 (diff)
latest twisted supports sockets with python3
-rwxr-xr-xsrc/kajonggtest.py14
-rw-r--r--src/login.py8
2 files changed, 9 insertions, 13 deletions
diff --git a/src/kajonggtest.py b/src/kajonggtest.py
index 1d0c943..0d3ce9b 100755
--- a/src/kajonggtest.py
+++ b/src/kajonggtest.py
@@ -170,7 +170,7 @@ class Server(StrMixin):
assert self.process is None, 'Server.start already has a process'
self.jobs.append(job)
assert self.commitId == job.commitId
- print('starting server for commit=%s in %s' % (job.commitId, self.clone.tmpdir))
+ print('starting server for %s commit=%s in %s' % (' ' * 16, job.commitId, self.clone.tmpdir))
cmd = [os.path.join(
job.srcDir(),
'kajonggserver3.py' if OPTIONS.server3 else 'kajonggserver.py')]
@@ -275,9 +275,9 @@ class Job(StrMixin):
tester=u'Tüster'.encode('utf-8')),
'--ruleset={ap}'.format(ap=self.ruleset)]
if self.server.socketName:
- cmd.append('--socket={sock}'.format(sock=self.server.socketName))
+ cmd.append('--socket={sock}'.format(sock=self.server.socketName))
if self.server.portNumber:
- cmd.append('--port={port}'.format(port=self.server.portNumber))
+ cmd.append('--port={port}'.format(port=self.server.portNumber))
if OPTIONS.client3:
cmd.insert(0, 'python3')
elif os.name == 'nt':
@@ -640,12 +640,10 @@ def parse_options():
help=Debug.help())
parser.add_option(
'', '--client3', dest='client3', action='store_true', default=False,
- help='use Python 3 for all clients. This will use ports instead of sockets because'
- ' twisted does not yet support sockets for Python 3')
+ help='use Python 3 for all clients')
parser.add_option(
'', '--server3', dest='server3', action='store_true', default=False,
- help='use Python 3 for all servers. This will use ports instead of sockets because'
- ' twisted does not yet support sockets for Python 3')
+ help='use Python 3 for all servers')
return parser.parse_args()
@@ -722,7 +720,7 @@ def improve_options():
OPTIONS.jobs = allJobs()
OPTIONS.games = allGames()
OPTIONS.jobCount = 0
- OPTIONS.usePort = os.name == 'nt' or OPTIONS.server3 or OPTIONS.client3
+ OPTIONS.usePort = os.name == 'nt'
def allGames():
diff --git a/src/login.py b/src/login.py
index 79ba29f..5765564 100644
--- a/src/login.py
+++ b/src/login.py
@@ -41,8 +41,8 @@ from dialogs import DeferredDialog, QuestionYesNo, MustChooseKDialog
from log import logWarning, logException, logInfo, logDebug, m18n, m18nc, SERVERMARK
from util import removeIfExists, which
-from common import Internal, Options, SingleshotOptions, Internal, Debug, isAlive, english, unicode
-from common import isPython3, nativeString
+from common import Internal, Options, SingleshotOptions, Debug, isAlive, english, unicode
+from common import nativeString, unicodeString
from game import Players
from query import Query
from statesaver import StateSaver
@@ -114,9 +114,7 @@ class Url(unicode):
return (
self.host == '127.0.0.1'
and os.name != 'nt'
- and not Options.port
- and not isPython3
- and not Options.server3)
+ and not Options.port)
@property
def isLocalGame(self):