[Python-apps-commits] r3270 - in packages/autokey/trunk (13 files)

ffm-guest at users.alioth.debian.org ffm-guest at users.alioth.debian.org
Sun Jul 12 20:35:30 UTC 2009


    Date: Sunday, July 12, 2009 @ 20:35:26
  Author: ffm-guest
Revision: 3270

Import debian/ directory into repository.

Added:
  packages/autokey/trunk/debian/
  packages/autokey/trunk/debian/autokey.1
  packages/autokey/trunk/debian/autokey.init
  packages/autokey/trunk/debian/changelog
  packages/autokey/trunk/debian/compat
  packages/autokey/trunk/debian/control
  packages/autokey/trunk/debian/copyright
  packages/autokey/trunk/debian/docs
  packages/autokey/trunk/debian/postinst
  packages/autokey/trunk/debian/prerm
  packages/autokey/trunk/debian/pycompat
  packages/autokey/trunk/debian/rules
  packages/autokey/trunk/debian/watch

Added: packages/autokey/trunk/debian/autokey.1
===================================================================
--- packages/autokey/trunk/debian/autokey.1	                        (rev 0)
+++ packages/autokey/trunk/debian/autokey.1	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,53 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH AUTOKEY "1" "July 9, 2009"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+autokey \- keyboard automation utility
+.SH SYNOPSIS
+.B autokey
+.RI [ options ]
+.SH DESCRIPTION
+This manual page briefly documents the
+.B autokey
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBautokey\fP is a text expansion/replacement and hotkey utility for Linux and X11.
+It can receive keyboard events via several methods and uses X events to drive the expansions. 
+It is designed to save time by automating repetitive typing tasks, among other things.
+.br
+For more information refer to the online manual at:
+    http://autokey.wiki.sourceforge.net/
+.SH OPTIONS
+This program follows the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-verbose
+Enable verbose (debug) logging.
+.TP
+.B \-c, \-\-configure
+Show the configuration window on startup, even if this is not the first run.
+.SH AUTHOR
+AutoKey was written by Chris Dekter, loosely based on a script by Sam Peterson.
+.PP
+This manual page was written by Chris Dekter <cdekter at gmail.com>.

Added: packages/autokey/trunk/debian/autokey.init
===================================================================
--- packages/autokey/trunk/debian/autokey.init	                        (rev 0)
+++ packages/autokey/trunk/debian/autokey.init	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,129 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+### BEGIN INIT INFO
+# Provides:          autokey
+# Required-Start:    
+# Required-Stop:     
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start AutoKey daemon.
+# Description:       Enable AutoKey's EvDev interface daemon.
+### END INIT INFO
+
+import sys, os, socket, glob, shutil
+from autokey import evdev, daemon
+from autokey.interface import DOMAIN_SOCKET_PATH, PACKET_SIZE
+
+PACKET_STRING = "%s,%s,%s"
+
+class AutoKeyDaemon(daemon.Daemon):
+
+    def __init__(self):
+        logFile = "/var/log/autokey-daemon.log"
+        if os.path.exists(logFile):
+            shutil.move(logFile, logFile + '.old')
+        daemon.Daemon.__init__(self, '/tmp/autokey-daemon.pid', stdout=logFile, stderr=logFile)
+
+    def get_device_paths(self):
+        keyboardLocations = glob.glob("/dev/input/by-path/*-event-kbd")
+        mouseLocations = glob.glob("/dev/input/by-path/*-event-mouse")
+    
+        sys.stdout.write("Keyboards: %s\nMice: %s\n" % (repr(keyboardLocations), repr(mouseLocations)))
+        return keyboardLocations + mouseLocations
+    
+    def run(self):
+        print "AutoKey daemon starting"
+        if os.path.exists(DOMAIN_SOCKET_PATH):
+            os.remove(DOMAIN_SOCKET_PATH)
+        s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+        s.bind(DOMAIN_SOCKET_PATH)
+        os.chmod(DOMAIN_SOCKET_PATH, 0777)
+        print "Created domain socket"
+
+        while True:
+            s.listen(1)
+            try:
+                conn, addr = s.accept()
+                print "Accepted connection"
+            except:
+                print "Fatal error while accepting connections - daemon shutting down"
+                break
+            
+            devices = evdev.DeviceGroup(self.get_device_paths())
+            sys.stdout.flush()
+            sys.stderr.flush()
+            
+            while True:
+                event = devices.next_event()
+                if event is not None:
+                    if event.type == "EV_KEY" and isinstance(event.code, str):
+                        if event.code.startswith("KEY"):
+                            # Keyboard event
+                            code = event.scanCode
+                            button = ''
+                            state = event.value
+                            
+                            try:
+                                self.send_packet(conn, code, button, state)
+                            except:
+                                break
+    
+                        elif event.code.startswith("BTN") and event.value == 1:
+                            # Mouse event - only care about button press, not release
+                            code = ''
+                            button = event.code
+                            state = event.value
+    
+                            try:
+                                self.send_packet(conn, code, button, state)
+                            except:
+                                break
+
+            conn.close()
+            devices.close()
+            print "Connection closed"
+            sys.stdout.flush()
+            sys.stderr.flush()
+                       
+    def send_packet(self, conn, code, button, state):
+        if code:
+            code = self.translate_keycode(code)
+        sendData = PACKET_STRING % (code, button, state)
+        sendData += (PACKET_SIZE - len(sendData)) * ' '
+        conn.send(sendData)
+    
+    def translate_keycode(self, keyCode):
+        if keyCode < 151:
+            keyCode += 8
+        else:
+            print "Got untranslatable evdev keycode: %d\n" % keyCode
+            keyCode = 0
+        return keyCode
+    
+
+if __name__ == "__main__":
+    #daemon = AutoKeyDaemon('/tmp/autokey-daemon.pid', stdout=sys.__stdout__, stderr=sys.__stderr__)
+    daemon = AutoKeyDaemon()
+    if len(sys.argv) == 2:
+        if 'start' == sys.argv[1]:
+            daemon.start()
+        elif 'stop' == sys.argv[1]:
+            daemon.stop()
+        elif 'restart' == sys.argv[1]:
+            daemon.restart()
+        elif 'force-reload' == sys.argv[1]:
+            # we don't support on-the-fly reloading,
+            # so just restart the daemon per DPM 9.3.2
+            daemon.restart()            
+        else:
+            print "Unknown command"
+            sys.exit(2)
+        sys.exit(0)
+    else:
+        print "usage: %s {start|stop|restart|force-reload}" % sys.argv[0]
+        sys.exit(2)
+    
+    sys.exit(0)
+            
+    

Added: packages/autokey/trunk/debian/changelog
===================================================================
--- packages/autokey/trunk/debian/changelog	                        (rev 0)
+++ packages/autokey/trunk/debian/changelog	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,5 @@
+autokey (0.54.4-1) unstable; urgency=low
+
+  * Initial release. (Closes: #536629)
+
+ -- Luke Faraone <luke at faraone.cc>  Sun, 12 Jul 2009 12:13:38 -0400

Added: packages/autokey/trunk/debian/compat
===================================================================
--- packages/autokey/trunk/debian/compat	                        (rev 0)
+++ packages/autokey/trunk/debian/compat	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1 @@
+6

Added: packages/autokey/trunk/debian/control
===================================================================
--- packages/autokey/trunk/debian/control	                        (rev 0)
+++ packages/autokey/trunk/debian/control	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,20 @@
+Source: autokey
+Section: gnome
+Priority: optional
+Maintainer: Luke Faraone <luke at faraone.cc>
+Uploaders: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Build-Depends: python (>= 2.6), cdbs (>= 0.4.49), debhelper (>= 6), python-setuptools
+Build-Depends-indep: python-central (>= 0.6.0)
+Standards-Version: 3.8.0
+XS-Python-Version: >= 2.6
+Homepage: http://autokey.sf.net/
+
+Package: autokey
+Architecture: all
+Depends: ${python:Depends}, ${misc:Depends}, python-gtk2, python-gobject, python-xlib, python-configobj, python-notify, librsvg2-2
+XB-Python-Version: ${python:Versions}
+Description: Text expansion and hotkey utility
+ AutoKey is a text expansion/replacement and hotkey utility for Linux and X11.
+ It can receive keyboard events via several methods and uses X events to drive 
+ the expansions. It is designed to save time by automating repetitive typing 
+ tasks, among other things.

Added: packages/autokey/trunk/debian/copyright
===================================================================
--- packages/autokey/trunk/debian/copyright	                        (rev 0)
+++ packages/autokey/trunk/debian/copyright	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,38 @@
+This package was debianized by Chris Dekter <cdekter at gmail.com> on
+Tue, 12 May 2009 19:35:37 +1000.
+
+It was downloaded from http://autokey.sourceforge.net/
+
+Upstream Authors:
+
+    Chris Dekter <cdekter at gmail.com>
+    Sam Peterson <peabodyenator at gmail.com>
+
+Copyright:
+
+    Copyright © 2009 Chris Dekter
+
+License:
+
+    This package 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 package 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 package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
+The Debian packaging is 
+
+    Copyright © 2009, Chris Dekter <cdekter at gmail.com> 
+
+and is licensed under the GPL, see above.

Added: packages/autokey/trunk/debian/docs
===================================================================
--- packages/autokey/trunk/debian/docs	                        (rev 0)
+++ packages/autokey/trunk/debian/docs	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,4 @@
+ACKNOWLEDGMENTS
+README
+PKG-INFO
+TODO
\ No newline at end of file

Added: packages/autokey/trunk/debian/postinst
===================================================================
--- packages/autokey/trunk/debian/postinst	                        (rev 0)
+++ packages/autokey/trunk/debian/postinst	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,37 @@
+#!/bin/sh
+# postinst script for test
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+# Automatically added by dh_installinit
+if [ -x "/etc/init.d/autokey" ]; then
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d autokey start || exit $?
+	else
+		/etc/init.d/autokey start || exit $?
+	fi
+fi
+# End automatically added section
+
+
+exit 0

Added: packages/autokey/trunk/debian/prerm
===================================================================
--- packages/autokey/trunk/debian/prerm	                        (rev 0)
+++ packages/autokey/trunk/debian/prerm	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,34 @@
+#!/bin/sh
+# prerm script for test
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# Automatically added by dh_installinit
+if [ -x "/etc/init.d/autokey" ]; then
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d autokey stop || exit $?
+	else
+		/etc/init.d/autokey stop || exit $?
+	fi
+fi
+# End automatically added section
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

Added: packages/autokey/trunk/debian/pycompat
===================================================================
--- packages/autokey/trunk/debian/pycompat	                        (rev 0)
+++ packages/autokey/trunk/debian/pycompat	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1 @@
+2

Added: packages/autokey/trunk/debian/rules
===================================================================
--- packages/autokey/trunk/debian/rules	                        (rev 0)
+++ packages/autokey/trunk/debian/rules	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+
+DEB_PYTHON_SYSTEM=pycentral
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
+
+
+# Add here any variable or target overrides you need.
+DEB_INSTALL_MANPAGES_autokey = debian/autokey.1
+DEB_DH_INSTALLINIT_ARGS := --no-start


Property changes on: packages/autokey/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
   + *

Added: packages/autokey/trunk/debian/watch
===================================================================
--- packages/autokey/trunk/debian/watch	                        (rev 0)
+++ packages/autokey/trunk/debian/watch	2009-07-12 20:35:26 UTC (rev 3270)
@@ -0,0 +1,2 @@
+version=2
+http://sf.net/autokey/autokey_(.+)\.tar\.gz 




More information about the Python-apps-commits mailing list