update service script style, add translations.xml
This commit is contained in:
+34
-9
@@ -37,17 +37,20 @@ temp_pspec = '''<?xml version="1.0" ?>
|
|||||||
<Dependency versionFrom=""></Dependency>
|
<Dependency versionFrom=""></Dependency>
|
||||||
<Dependency></Dependency>
|
<Dependency></Dependency>
|
||||||
</BuildDependencies>
|
</BuildDependencies>
|
||||||
<!--
|
|
||||||
<Patches>
|
<Patches>
|
||||||
|
<!--
|
||||||
<Patch level="1"></Patch>
|
<Patch level="1"></Patch>
|
||||||
|
-->
|
||||||
</Patches>
|
</Patches>
|
||||||
-->
|
|
||||||
</Source>
|
</Source>
|
||||||
|
|
||||||
<Package>
|
<Package>
|
||||||
<Name>%(package)s</Name>
|
<Name>%(package)s</Name>
|
||||||
<RuntimeDependencies>
|
<RuntimeDependencies>
|
||||||
</RuntimeDependencies>
|
</RuntimeDependencies>
|
||||||
|
<Conflicts>
|
||||||
|
<Package releaseTo="29">sleep</Package>
|
||||||
|
</Conflicts>
|
||||||
<Files>
|
<Files>
|
||||||
<Path fileType="data">/</Path>
|
<Path fileType="data">/</Path>
|
||||||
</Files>
|
</Files>
|
||||||
@@ -118,29 +121,40 @@ StartupNotify=false
|
|||||||
Categories=Application;Game;ArcadeGame;
|
Categories=Application;Game;ArcadeGame;
|
||||||
'''
|
'''
|
||||||
|
|
||||||
temp_service = '''serviceType = "local"
|
temp_service = '''
|
||||||
from comar.service import *
|
from comar.service import *
|
||||||
|
|
||||||
serviceType = "local"
|
serviceType = "local"
|
||||||
serviceDefault = "off"
|
serviceConf = "%(package)s"
|
||||||
|
serviceDefault = "conditional"
|
||||||
|
|
||||||
serviceDesc = _({"en": "%(package_cap)s",
|
serviceDesc = _({"en": "%(package_cap)s",
|
||||||
"tr": "%(package_cap)s"})
|
"tr": "%(package_cap)s"})
|
||||||
|
|
||||||
|
@synchronized
|
||||||
def start():
|
def start():
|
||||||
if 0 == run('/sbin/start-stop-daemon --quiet --start --exec /usr/bin/%(package)s --pidfile /var/run/%(package)s.pid'):
|
startService(command="/usr/sbin/%(package)s",
|
||||||
notify("System.Service.changed", "started")
|
args = config.get("args", "destroy"),
|
||||||
|
donotify=True)
|
||||||
|
|
||||||
|
@synchronized
|
||||||
def stop():
|
def stop():
|
||||||
if 0 == run("/sbin/start-stop-daemon --stop --pidfile /var/run/%(package)s.pid"):
|
stopService(command="/usr/sbin/%(package)s",
|
||||||
notify("System.Service.changed", "stopped")
|
donotify=True)
|
||||||
|
|
||||||
|
def ready():
|
||||||
|
import os
|
||||||
|
status = is_on()
|
||||||
|
if status == "on" or (status == "conditional" and os.path.exists("/sys/coffee/ready")):
|
||||||
|
start()
|
||||||
|
|
||||||
def status():
|
def status():
|
||||||
return checkDeamon("/var/run/%(package)s.pid")
|
return checkDaemon("/var/run/%(package)s.pid")
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
temp_postscript = '''#/usr/bin/python
|
temp_postscript = '''#/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -149,6 +163,16 @@ def postInstall():
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
temp_translation = '''<?xml version="1.0" ?>
|
||||||
|
<PISI>
|
||||||
|
<Source>
|
||||||
|
<Name>%(package)s</Name>
|
||||||
|
<Summary xml:lang=""></Summary>
|
||||||
|
<Description xml:lang=""></Description>
|
||||||
|
</Source>
|
||||||
|
</PISI>
|
||||||
|
'''
|
||||||
|
|
||||||
def write(filename, data):
|
def write(filename, data):
|
||||||
try:
|
try:
|
||||||
f = file("%s/%s" % (target, filename), "w")
|
f = file("%s/%s" % (target, filename), "w")
|
||||||
@@ -205,6 +229,7 @@ data["packager_name"], data["packager_email"] = readConfig()
|
|||||||
create_dirs()
|
create_dirs()
|
||||||
write("pspec.xml", temp_pspec % data)
|
write("pspec.xml", temp_pspec % data)
|
||||||
write("actions.py", temp_actions % data)
|
write("actions.py", temp_actions % data)
|
||||||
|
write("translations.xml", temp_translation % data)
|
||||||
write("files/%s.desktop" % data["package"], temp_desktop % data)
|
write("files/%s.desktop" % data["package"], temp_desktop % data)
|
||||||
write("comar/service.py", temp_service % data)
|
write("comar/service.py", temp_service % data)
|
||||||
write("comar/package.py", temp_postscript)
|
write("comar/package.py", temp_postscript)
|
||||||
|
|||||||
Reference in New Issue
Block a user