SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
PROGRAM=DialCentral
-ICON_SIZES=26 32 48 80
+ICON_SIZES=26 32 48 64 80
ICONS=$(foreach size, $(ICON_SIZES), data/icons/$(size)/$(PROJECT_NAME).png)
PACKAGE_VARIANTS=fremantle harmattan ubuntu
DESKTOP_FILES=$(foreach variant, $(PACKAGE_VARIANTS), data/$(variant)/$(PROJECT_NAME).desktop)
test: $(OBJ)
$(UNIT_TEST)
-package: $(OBJ) $(ICONS) $(SETUP_FILES) $(DESKTOP_FILES)
- rm -Rf $(DIST_BASE_PATH)_*/*
+_package_prep: $(OBJ) $(ICONS) $(SETUP_FILES) $(DESKTOP_FILES)
+
+package_diablo: _package_prep
+ rm -Rf $(DIST_BASE_PATH)_diablo/*
./setup.fremantle.py sdist_diablo \
-d $(DIST_BASE_PATH)_diablo \
--install-purelib=/usr/lib/python2.5/site-packages
+package_fremantle: _package_prep
+ rm -Rf $(DIST_BASE_PATH)_fremantle/*
./setup.fremantle.py sdist_fremantle \
-d $(DIST_BASE_PATH)_fremantle \
--install-purelib=/usr/lib/python2.5/site-packages
+package_harmattan: _package_prep
+ rm -Rf $(DIST_BASE_PATH)_harmattan/*
./setup.harmattan.py sdist_harmattan \
- -d $(DIST_BASE_PATH)_harmattan
+ -d $(DIST_BASE_PATH)_harmattan \
--install-purelib=/usr/lib/python2.6/dist-packages
+package_ubuntu: _package_prep
+ rm -Rf $(DIST_BASE_PATH)_ubuntu/*
./setup.ubuntu.py sdist_ubuntu \
-d $(DIST_BASE_PATH)_ubuntu
mkdir $(DIST_BASE_PATH)_ubuntu/build
cd $(DIST_BASE_PATH)_ubuntu/build ; tar -zxvf ../*.tar.gz
cd $(DIST_BASE_PATH)_ubuntu/build ; dpkg-buildpackage -tc -rfakeroot -us -uc
-upload:
+package: package_diablo package_fremantle package_harmattan package_ubuntu
+
+upload_diablo:
dput diablo-extras-builder $(DIST_BASE_PATH)_diablo/$(PROJECT_NAME)*.changes
+upload_fremantle:
dput fremantle-extras-builder $(DIST_BASE_PATH)_fremantle/$(PROJECT_NAME)*.changes
+upload_harmattan:
+ ./support/obs_upload.sh $(PROJECT_NAME) harmattan dist_harmattan
+upload_ubuntu:
cp $(DIST_BASE_PATH)_ubuntu/*.deb www/$(PROJECT_NAME).deb
+upload: upload_diablo upload_fremantle upload_harmattan upload_ubuntu
+
lint: $(OBJ)
$(foreach file, $(SOURCE), $(LINT) $(file) ; )
rm -Rf $(OBJ)
rm -Rf $(TODO_FILE)
rm -f $(ICONS) $(SETUP_FILES) $(DESKTOP_FILES)
- rm -Rf $(DIST_PATHS)
+ rm -Rf $(DIST_PATHS) ./build
distclean: clean
find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
cog.py -c \
-D DESKTOP_FILE_PATH=/usr/share/applications \
-D INPUT_DESKTOP_FILE=data/$(VARIANT)/$(PROJECT_NAME).desktop \
- -D ICON_CATEGORY=hildon \
- -D ICON_SIZES=32,80 \
+ -D ICON_CATEGORY=apps \
+ -D ICON_SIZES=64,80 \
-o $@ $<
chmod +x $@
cog.py -d \
-D VARIANT=$(VARIANT) \
-D PROGRAM=$(PROGRAM) \
+ -D ICON_NAME=$(PROJECT_NAME) \
-o $@ $<
# cog.outl("Exec=/usr/local/bin/%s" % PROGRAM)
# else:
# raise RuntimeError("Unsupported desktop file flavor %r" % PROGRAM)
+#
+# if VARIANT == "harmattan":
+# cog.outl("Icon=/usr/share/icons/hicolor/80x80/apps/%s.png" % ICON_NAME)
+# else:
+# cog.outl("Icon=%s" % ICON_NAME)
#]]]
Exec=/usr/local/bin/DialCentral
-#[[[end]]]
Icon=dialcentral
+#[[[end]]]
Categories=Network;InstantMessaging;Qt;
Type=Application
Encoding=UTF-8
from xml.etree import ElementTree
try:
- import simplejson as _simplejson
- simplejson = _simplejson
+ import json as _json
+ simplejson = _json
except ImportError:
- simplejson = None
+ try:
+ import simplejson as _simplejson
+ simplejson = _simplejson
+ except ImportError:
+ simplejson = None
import browser_emu
_moduleLogger.warning('Unable to set processName: %s" % e')
-def get_new_resource(resourceType, resource, name):
+def _get_xdg_path(resourceType):
if BaseDirectory is not None:
if resourceType == "data":
base = BaseDirectory.xdg_data_home
if base == "/usr/share/mime":
# Ugly hack because somehow Maemo 4.1 seems to be set to this
- base = os.path.join(os.path.expanduser("~"), ".%s" % resource)
+ base = None
elif resourceType == "config":
base = BaseDirectory.xdg_config_home
elif resourceType == "cache":
else:
raise RuntimeError("Unknown type: "+resourceType)
else:
+ base = None
+
+ return base
+
+
+def get_resource_path(resourceType, resource, name = None):
+ base = _get_xdg_path(resourceType)
+ if base is not None:
+ dirPath = os.path.join(base, resource)
+ else:
base = os.path.join(os.path.expanduser("~"), ".%s" % resource)
+ dirPath = base
+ if name is not None:
+ dirPath = os.path.join(dirPath, name)
+ return dirPath
+
- filePath = os.path.join(base, resource, name)
- dirPath = os.path.dirname(filePath)
+def get_new_resource(resourceType, resource, name):
+ dirPath = get_resource_path(resourceType, resource)
+ filePath = os.path.join(dirPath, name)
if not os.path.exists(dirPath):
# Looking before I leap to not mask errors
os.makedirs(dirPath)
def get_existing_resource(resourceType, resource, name):
- if BaseDirectory is not None:
- if resourceType == "data":
- base = BaseDirectory.xdg_data_home
- elif resourceType == "config":
- base = BaseDirectory.xdg_config_home
- elif resourceType == "cache":
- base = BaseDirectory.xdg_cache_home
- else:
- raise RuntimeError("Unknown type: "+resourceType)
- else:
- base = None
+ base = _get_xdg_path(resourceType)
if base is not None:
finalPath = os.path.join(base, name)
from __future__ import with_statement
from __future__ import division
-_TRY_PYSIDE = False
+_TRY_PYSIDE = True
try:
if not _TRY_PYSIDE:
del self.__modifiers["<%s>" % modifierName]
def map_slice_action(self, slice, action):
- callback = lambda direction: self(direction, action)
+ callback = lambda: self(action)
slice.action().triggered.connect(callback)
self.__sliceActions[slice] = (action, callback)
- def __call__(self, direction, action):
+ def __call__(self, action):
activeModifiers = [
mod.name
for mod in self.__modifiers.itervalues()
},
data_files=[
(DESKTOP_FILE_PATH, [INPUT_DESKTOP_FILE]),
+ ("/usr/share/icons/hicolor/scalable/apps", ["data/%s.svg" % APP_NAME]),
] +
[
(
],
requires=[
"PySide",
- "simplejson",
"xml",
],
cmdclass={
"copyright": "lgpl",
"changelog": CHANGES,
"buildversion": str(BUILD),
- "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-simplejson, python-xml, python-dbus, python-gst0.10",
+ "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-xdg, python-dbus, python-gst0.10",
"architecture": "any",
},
"sdist_diablo": {
"copyright": "lgpl",
"changelog": CHANGES,
"buildversion": str(BUILD),
- "depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui, python-simplejson, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
+ "depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui, python-xdg, python-simplejson, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
"architecture": "any",
},
"sdist_fremantle": {
"copyright": "lgpl",
"changelog": CHANGES,
"buildversion": str(BUILD),
- "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-pyside.qtmaemo5, python-simplejson, python-gst0.10, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
+ "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-pyside.qtmaemo5, python-xdg, python-simplejson, python-gst0.10, python-xml | python2.5-xml, python-dbus | python2.5-dbus",
"architecture": "any",
},
"sdist_harmattan": {
"copyright": "lgpl",
"changelog": CHANGES,
"buildversion": str(BUILD),
- "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-simplejson, python-xml",
+ "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-xdg",
"architecture": "any",
},
"bdist_rpm": {
--- /dev/null
+#!/usr/bin/env bash
+
+# Doing the pushd as a test of directory movement to try to be safer with the "rm"
+pushd ../../osc/home:epage:$2/$1 && rm $1_*.dsc $1_*.tar.gz
+popd
+
+cp $3/$1_*.dsc $3/$1_*.tar.gz ../../osc/home:epage:$2/$1
+
+pushd ../../osc/home:epage:$2/$1
+
+osc addremove && osc commit
+
+popd