From: epage Date: Sat, 30 May 2009 22:56:48 +0000 (+0000) Subject: Bringing in some tweaks from quicknote X-Git-Url: http://git.maemo.org/git/?p=gc-dialer;a=commitdiff_plain;h=42770e2ae287d8b7f0627ae359f350097f97e3d2 Bringing in some tweaks from quicknote git-svn-id: file:///svnroot/gc-dialer/trunk@352 c39d3808-3fe2-4d86-a59f-b7f623ee9f21 --- diff --git a/Makefile b/Makefile index c8dc124..58d7ee8 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,7 @@ build: $(OBJ) cp support/icons/hicolor/64x64/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/64x64-$(PROJECT_NAME).png cp support/icons/hicolor/scalable/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/scale-$(PROJECT_NAME).png cp support/builddeb.py $(BUILD_PATH) + cp support/fake_py2deb.py $(BUILD_PATH) lint: $(OBJ) $(foreach file, $(SOURCE), $(LINT) $(file) ; ) diff --git a/support/builddeb.py b/support/builddeb.py index ed720ca..0c8b495 100755 --- a/support/builddeb.py +++ b/support/builddeb.py @@ -3,7 +3,10 @@ import os import sys -import py2deb +try: + import py2deb +except ImportError: + import fake_py2deb as py2deb import constants @@ -90,9 +93,9 @@ __changelog__ = ''' ''' -__postinstall__ = '''#!/bin/sh +__postinstall__ = '''#!/bin/sh -e -gtk-update-icon-cache /usr/share/icons/hicolor +gtk-update-icon-cache -f /usr/share/icons/hicolor ''' @@ -135,7 +138,7 @@ if __name__ == "__main__": p.repository = "extras" p.changelog = __changelog__ p.postinstall = __postinstall__ - p.icon="26x26-dialcentral.png" + p.icon = "26x26-dialcentral.png" p["/usr/bin"] = [ "dialcentral.py" ] for relPath, files in unflatten_files(find_files(".")).iteritems(): fullPath = "/usr/lib/dialcentral" diff --git a/support/fake_py2deb.py b/support/fake_py2deb.py new file mode 100644 index 0000000..5d6149d --- /dev/null +++ b/support/fake_py2deb.py @@ -0,0 +1,56 @@ +import pprint + + +class Py2deb(object): + + def __init__(self, appName): + self._appName = appName + self.description = "" + self.author = "" + self.mail = "" + self.license = "" + self.depends = "" + self.section = "" + self.arch = "" + self.ugency = "" + self.distribution = "" + self.repository = "" + self.changelog = "" + self.postinstall = "" + self.icon = "" + self._install = {} + + def generate(self, appVersion, appBuild, changelog, tar, dsc, changes, build, src): + return """ +Package: %s +version: %s-%s +Changes: +%s + +Build Options: + Tar: %s + Dsc: %s + Changes: %s + Build: %s + Src: %s + """ % ( + self._appName, appVersion, appBuild, changelog, tar, dsc, changes, build, src + ) + + def __str__(self): + parts = [] + parts.append("%s Package Settings:" % (self._appName, )) + for settingName in dir(self): + if settingName.startswith("_"): + continue + parts.append("\t%s: %s" % (settingName, getattr(self, settingName))) + + parts.append(pprint.pformat(self._install)) + + return "\n".join(parts) + + def __getitem__(self, key): + return self._install[key] + + def __setitem__(self, key, item): + self._install[key] = item diff --git a/tests/dummy_hildon/hildon.py b/tests/dummy_hildon/hildon.py index c6f2bc2..331e979 100644 --- a/tests/dummy_hildon/hildon.py +++ b/tests/dummy_hildon/hildon.py @@ -1,6 +1,17 @@ import gobject import gtk +class FileChooserDialog(gtk.FileChooserDialog): + """ + @bug The buttons currently don't do anything + """ + + def __init__(self, *args, **kwds): + super(FileChooserDialog, self).__init__(*args, **kwds) + self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) + self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) + + class Program(object): def add_window(self, window): @@ -9,6 +20,10 @@ class Program(object): class Window(gtk.Window, object): + def __init__(self): + super(Window, self).__init__(gtk.WINDOW_TOPLEVEL) + self.set_default_size(700, 500) + def set_menu(self, menu): self._hildonMenu = menu