summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-03 07:07:31 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 10:26:52 (GMT)
commit71e0f56531d8c2904569e1392640d912e1571bf4 (patch)
tree7af953f3e2ae517ffbc3b0a246bd753b4f3bce7d
parentf8f61861c627ff415a23db04c2748dfbbcb18152 (diff)
new: kajonggserver3. Use it when Options.server3
-rw-r--r--CMakeLists.txt1
-rwxr-xr-xsetup.py4
-rwxr-xr-xsrc/kajonggserver3.py28
-rwxr-xr-xsrc/kajonggtest.py4
-rw-r--r--src/login.py2
5 files changed, 36 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 629bda8..f850c0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,6 +110,7 @@ IF(INSTALL_KAJONGG)
install(FILES src/kajonggui.rc DESTINATION ${DATA_INSTALL_DIR}/kajongg)
PYKDE4_ADD_EXECUTABLE(kajongg.py kajongg)
PYKDE4_ADD_EXECUTABLE(kajonggserver.py kajonggserver)
+ PYKDE4_ADD_EXECUTABLE(kajonggserver3.py kajonggserver3)
kde4_install_icons(${ICON_INSTALL_DIR})
install(PROGRAMS kajongg.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kajongg.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata)
diff --git a/setup.py b/setup.py
index 4126088..d6ba93f 100755
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,7 @@ for ignFile in os.listdir('src'):
os.remove(os.path.join('src', ignFile))
data_files = [ \
- (kdeDirs['exe'], ['kajongg','kajonggserver']),
+ (kdeDirs['exe'], ['kajongg','kajonggserver', 'kajonggserver3']),
(os.path.join(kdeDirs['data'], 'kajongg'), app_files),
(os.path.join(kdeDirs['html'], 'en','kajongg'), doc_files),
(kdeDirs['xdgdata-apps'], ['kajongg.desktop']),
@@ -91,7 +91,7 @@ extra = {}
class KmjBuild(build):
def run(self):
- for binary in ['kajongg','kajonggserver']:
+ for binary in ['kajongg','kajonggserver', 'kajonggserver3']:
open(binary, 'w').write('#!/bin/sh\nexec %skajongg/%s.py $*\n' % (kdeDirs['data'], binary))
os.chmod(binary, 0755 )
call(['cp hisc-apps-kajongg.svgz kajongg.svgz'], shell=True)
diff --git a/src/kajonggserver3.py b/src/kajonggserver3.py
new file mode 100755
index 0000000..63f08e9
--- /dev/null
+++ b/src/kajonggserver3.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+"""
+Copyright (C) 2009-2014 Wolfgang Rohdewald <wolfgang@rohdewald.de>
+
+Kajongg is free software you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+"""
+
+from server import kajonggServer
+from util import checkMemory
+
+kajonggServer()
+checkMemory()
+# profileMe()
diff --git a/src/kajonggtest.py b/src/kajonggtest.py
index 657bf98..1d0c943 100755
--- a/src/kajonggtest.py
+++ b/src/kajonggtest.py
@@ -171,7 +171,9 @@ class Server(StrMixin):
self.jobs.append(job)
assert self.commitId == job.commitId
print('starting server for commit=%s in %s' % (job.commitId, self.clone.tmpdir))
- cmd = [os.path.join(job.srcDir(), 'kajonggserver.py')]
+ cmd = [os.path.join(
+ job.srcDir(),
+ 'kajonggserver3.py' if OPTIONS.server3 else 'kajonggserver.py')]
if OPTIONS.server3:
cmd.insert(0, 'python3')
elif os.name == 'nt':
diff --git a/src/login.py b/src/login.py
index a83f50f..79ba29f 100644
--- a/src/login.py
+++ b/src/login.py
@@ -195,6 +195,8 @@ class Url(unicode):
result = [tryServer]
else:
result = ['kajonggserver']
+ if Options.server3:
+ result[-1] = result[-1].replace('server', 'server3')
if Debug.connections:
logDebug(m18n('trying to start local server %1', result))
return result