--- cappuccino-0.5.1.orig/cappuccino +++ cappuccino-0.5.1/cappuccino @@ -1,13 +1,17 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- python -*- # -# Copyright (C) 2000-2006 Christopher R. Gabriel +# Copyright (C) 2000-2016 Christopher R. Gabriel # # This program 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. -import sys, gtk, os, gobject, os.path, glob, random +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk, GObject, GdkPixbuf + +import sys, os, os.path, random # FIXME: change with something based on the setup script try: @@ -15,22 +19,29 @@ PLUGIN_DIR = "./" except OSError: PLUGIN_DIR = "/usr/share/cappuccino/" - + +# text to see if polygen is available +if not os.access("/usr/games/polygen",os.X_OK): + print ("Error: polygen must be installed") + print ("See http://www.polygen.org") + sys.exit(1) + # to be discussed pipe_command = 'polygen %s' % os.path.join(PLUGIN_DIR, 'cappuccino.grm') -class CappuccinoSplash(gtk.Window): +class CappuccinoSplash(Gtk.Window): def __init__(self): - gtk.Window.__init__(self) - image = gtk.Image() - pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(PLUGIN_DIR,'cappuccino.jpg')) + Gtk.Window.__init__(self) + image = Gtk.Image() + pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.path.join(PLUGIN_DIR,\ + 'cappuccino.jpg')) image.set_from_pixbuf(pixbuf) self.add(image) - - -class Cappuccino(gtk.Window): + + +class Cappuccino(Gtk.Window): def __init__(self,title,speed=400): - gtk.Window.__init__(self) + Gtk.Window.__init__(self) # our data self.cur_position = 0.0 self.speed = speed @@ -42,25 +53,26 @@ self.set_title = title #window's widgets - self.w_vbox = gtk.VBox() + self.w_vbox = Gtk.VBox() - - self.w_label = gtk.Label() + + self.w_label = Gtk.Label() self.w_vbox.pack_start(self.w_label,True,True,40) - self.w_scroll = gtk.ScrolledWindow() - self.w_scroll.set_shadow_type(gtk.SHADOW_ETCHED_IN) - self.w_scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.w_scroll = Gtk.ScrolledWindow() + self.w_scroll.set_shadow_type(Gtk.ShadowType.ETCHED_IN) + self.w_scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.w_vbox.pack_start(self.w_scroll, True, True,100) - - self.w_text = gtk.TextView() + + self.w_text = Gtk.TextView() self.w_text.set_editable(False) self.w_scroll.add(self.w_text) - - self.w_align = gtk.Alignment(0.5,0.5,0.5,0.0) - self.w_vbox.pack_start(self.w_align, True, True) - self.progressbar = gtk.ProgressBar() + self.w_align = Gtk.Alignment() + self.w_align.set(0.5,0.5,0.5,0.0) + self.w_vbox.pack_start(self.w_align, True, True, 0) + + self.progressbar = Gtk.ProgressBar() # the bar is reset upon startup self.progressbar.set_fraction(0.0) self.w_align.add(self.progressbar) @@ -69,9 +81,9 @@ self.get_log_data() self.add(self.w_vbox) # timeout that starts it all - self.timeouter = gobject.timeout_add(self.speed, self.update) - self.log_timeouter = gobject.timeout_add(1000, self.update_log) - + self.timeouter = GObject.timeout_add(self.speed, self.update) + self.log_timeouter = GObject.timeout_add(1000, self.update_log) + # event handling. Add some key press events handlers!! self.connect("delete_event", self.delete_handler) self.connect("destroy_event", self.delete_handler) @@ -79,15 +91,15 @@ def delete_handler(self,obj,param): # remove the timeout upon delete or destroy event! - gobject.source_remove(self.timeouter) + GObject.source_remove(self.timeouter) def get_log_data(self): p = os.popen("polygen -X 50 %s" % os.path.join(PLUGIN_DIR,"compileline.grm")) self.log = p.readlines() p.close() - + def update_log(self): - + # do the log! if len(self.log) < 1: self.get_log_data() @@ -95,15 +107,15 @@ buf.insert_at_cursor(self.log.pop()) self.w_text.set_buffer(buf) ha = self.w_scroll.get_vadjustment() - ha.set_value(ha.upper) + ha.set_value(ha.get_upper()) self.w_scroll.set_vadjustment(ha) return True - + def update(self): - + self.cur_position += random.random() / 5.0 - + if self.cur_position > 1.2: self.cur_position = 0.0 self.current_message = self.new_phrase() @@ -124,17 +136,14 @@ def startup(par): par.destroy() app = Cappuccino(sys.argv[0]) - app.connect("delete_event", gtk.main_quit) - app.connect("destroy_event", gtk.main_quit) + app.connect("delete_event", Gtk.main_quit) + app.connect("destroy_event", Gtk.main_quit) app.show_all() - - + + if __name__ == "__main__": + Gtk.init_check() splash = CappuccinoSplash() splash.show_all() - t = gobject.timeout_add(3000, startup, splash) - gtk.main() - - - - + t = GObject.timeout_add(3000, startup, splash) + Gtk.main() --- cappuccino-0.5.1.orig/debian/changelog +++ cappuccino-0.5.1/debian/changelog @@ -1,3 +1,121 @@ +cappuccino (0.5.1-8ubuntu1) bionic; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - debian/compat: Bump to 9. + - debian/control: + + Build-depend on debhelper (>= 9). + * debian/rules: + - Add recommended build-arch and build-indep targets. + + -- Bhavani Shankar Tue, 07 Nov 2017 08:46:00 +0530 + +cappuccino (0.5.1-8) unstable; urgency=medium + + * Fixes broken symlink in /usr/games. Closes: #880714 + - Thanks to Chris Lamb. + + -- Breno Leitao Mon, 06 Nov 2017 14:25:01 -0500 + +cappuccino (0.5.1-7ubuntu1) bionic; urgency=medium + + * Merge from Debian unstable. Remaining changes: + - debian/compat: Bump to 9. + - debian/control: + + Build-depend on debhelper (>= 9). + * debian/rules: + - Add recommended build-arch and build-indep targets. + + + -- Bhavani Shankar Sun, 05 Nov 2017 19:10:14 +0530 + +cappuccino (0.5.1-7) unstable; urgency=medium + + * Adding gir1.2-gtk-3.0 as a dependency. Closes: #879848 + * Adding a link to /usr/games/cappuccino + + -- Breno Leitao Fri, 03 Nov 2017 07:52:46 -0400 + +cappuccino (0.5.1-6ubuntu1) zesty; urgency=medium + + * debian/compat: Bump to 9. + * debian/control: + - Build-depend on debhelper (>= 9). + * debian/rules: + - Add recommended build-arch and build-indep targets. + + -- Bhavani Shankar Sun, 12 Mar 2017 11:49:17 +0530 + +cappuccino (0.5.1-6) unstable; urgency=medium + + * Fix python dependency, moving the debian/rules file to + python3. Closes: #837325 + + -- Breno Leitao Wed, 28 Sep 2016 13:53:24 -0400 + +cappuccino (0.5.1-5) unstable; urgency=medium + + * Added upstream Homepage. + * Ported to Python version 3. + * Ported to GTK version 3. + + -- Breno Leitao Mon, 05 Sep 2016 12:59:55 -0400 + +cappuccino (0.5.1-4) unstable; urgency=medium + + * Fix segfault if DISPLAY is missing or invalid (Thanks to + Chris Lamb). Closes: #799403 + * Make the build reproducible (Thanks to Chris Lamb). Closes: #799330 + + -- Breno Leitao Sat, 20 Aug 2016 17:37:28 -0300 + +cappuccino (0.5.1-3) unstable; urgency=medium + + * New maintainer. Closes: #831558 + * Fix a polygen 'path not found' issue. Closes #834849 + + -- Breno Leitao Fri, 19 Aug 2016 17:15:23 -0300 + +cappuccino (0.5.1-2.3) unstable; urgency=medium + + * Non-maintainer upload. + * Use debhelper 5. Closes: #817387 + * debian/rules clean: remove .grm.o files. + + -- Bill Allombert Sun, 24 Jul 2016 16:17:42 +0200 + +cappuccino (0.5.1-2.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/rules + - add /usr/games to PATH (for polygen). Closes: #720685 + - fix build target to actually build, and binary-arch to actually generate + the package + * debian/control + - remove article from synopsis + - add ${misc:Depends} to Depends + + -- Bill Allombert Thu, 10 Oct 2013 22:42:57 +0200 + +cappuccino (0.5.1-2.1) unstable; urgency=low + + * Non-maintainer upload, to prepare for Python 2.6 transition + * debian/rules + - use '--install-layout=deb' when installing; thanks to Jakub Wilk for the + report; Closes: #571207 + * debian/control + - bump b-d on python to '>= 2.5.3-1~', to support install-layout + + -- Sandro Tosi Mon, 01 Mar 2010 13:14:53 +0100 + +cappuccino (0.5.1-2) unstable; urgency=low + + * "Don Zauker" Release: the upload + * debian/control: we need polygen to build + * debian/rules: now we build .grm.o files, to satisfy polygen + * debian/rules: we remove build/ directory in cleaning + + -- Christian Surchi Mon, 20 Nov 2006 23:59:05 +0100 + cappuccino (0.5.1-1) unstable; urgency=low * "Halloween Release": new upstream release --- cappuccino-0.5.1.orig/debian/compat +++ cappuccino-0.5.1/debian/compat @@ -1 +1 @@ -4 +9 --- cappuccino-0.5.1.orig/debian/control +++ cappuccino-0.5.1/debian/control @@ -1,14 +1,16 @@ Source: cappuccino Section: games Priority: optional -Maintainer: Christian Surchi -Standards-Version: 3.7.2 -Build-Depends: debhelper (>> 4.0.0), python +Homepage: https://labs.truelite.it/projects/cappuccino +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Breno Leitao +Build-Depends: debhelper (>= 9), python3, python3-gi, polygen +Standards-Version: 4.1.0 Package: cappuccino Architecture: all -Depends: python, python-gtk2, polygen -Description: an utility to let your boss think that you're working hard +Depends: python3, python3-gi, polygen, ${misc:Depends}, gir1.2-gtk-3.0 +Description: utility to let your boss think that you're working hard Run this software on your computer when you are not motivated to work, and enjoy doing something different. If your boss come in your cubicle, he'll think "Yeah, he's doing something different since his computer is really --- cappuccino-0.5.1.orig/debian/rules +++ cappuccino-0.5.1/debian/rules @@ -5,9 +5,11 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 - +PATH:=$(PATH):/usr/games build: build-stamp +buiild-arch: build-stamp +build-indep: build-stamp build-stamp: dh_testdir @@ -23,9 +25,10 @@ dh_testdir dh_testroot rm -f build-stamp - + rm -rf build/ # Add here commands to clean up after the build process. - python setup.py clean + python3 setup.py clean + rm -f *.grm.o #-$(MAKE) distclean dh_clean @@ -33,21 +36,22 @@ install: build dh_testdir dh_testroot - dh_clean -k + dh_prep dh_installdirs # Add here commands to install the package into debian/cappuccino. #$(MAKE) install prefix=$(CURDIR)/debian/cappuccino/usr #$(MAKE) install DESTDIR=$(CURDIR)/debian/cappuccino - python setup.py install --prefix=$(CURDIR)/debian/cappuccino/usr - + python3 setup.py install --prefix=$(CURDIR)/debian/cappuccino/usr --install-layout=deb + polygen -seed 0 $(CURDIR)/debian/cappuccino/usr/share/cappuccino/cappuccino.grm > /dev/null + polygen -seed 0 $(CURDIR)/debian/cappuccino/usr/share/cappuccino/compileline.grm > /dev/null + + # As it is considered a game, put a link at /usr/games + mkdir $(CURDIR)/debian/cappuccino/usr/games + ln -s /usr/bin/cappuccino $(CURDIR)/debian/cappuccino/usr/games/cappuccino # Build architecture-independent files here. binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install dh_testdir dh_testroot # dh_installdebconf @@ -76,5 +80,8 @@ dh_md5sums dh_builddeb +# Build architecture-dependent files here. +binary-arch: build install + binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install