Commit 71e0f565 authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

new: kajonggserver3. Use it when Options.server3

parent f8f61861
......@@ -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)
......
......@@ -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)
......
#!/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()
......@@ -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':
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment