* My bad with moving files and causing confusion with build_script
authorepage <eopage@byu.net>
Sun, 29 Jun 2008 04:23:53 +0000 (04:23 +0000)
committerepage <eopage@byu.net>
Sun, 29 Jun 2008 04:23:53 +0000 (04:23 +0000)
 * paste callback now exists, we just need a gui interface
 * Fixed a weird situation with double launch on desktiop
 * Restored the generator that was accidently lost in revision control

git-svn-id: file:///svnroot/gc-dialer/trunk@27 c39d3808-3fe2-4d86-a59f-b7f623ee9f21

build_script.sh
gc_dialer/build_script.sh [deleted file]
gc_dialer/gc_dialer.py
gc_dialer/gcbackend.py

index facfea5..0a554cd 100755 (executable)
@@ -34,9 +34,9 @@ cp gc_dialer/gc_dialer.xml     build/usr/local/lib
 # Compress whitespace for 30% savings, make sure we are a HildonWindow
 sed -i 's/^[ \t]*//;s/[ \t]*$//;s/GtkWindow/HildonWindow/' build/usr/local/lib/gc_dialer.xml
 
-echo "#!/usr/bin/python" > build/usr/local/bin/gc_dialer.py
+echo "#!/usr/bin/python2.5" > build/usr/local/bin/gc_dialer.py
 #echo "from __future__ import with_statement" >> build/usr/local/bin/gc_dialer.py
 cat gc_dialer/gc_dialer.py gc_dialer/gcbackend.py gc_dialer/browser_emu.py | grep -e '^import ' | sort -u >> build/usr/local/bin/gc_dialer.py
 echo "import hildon" >> build/usr/local/bin/gc_dialer.py
-cat gc_dialer/browser_emu.py gc_dialer/gcbackend.py gc_dialer/gc_dialer.py | grep -v 'import ' | grep -v "#!" >> build/usr/local/bin/gc_dialer.py
+cat gc_dialer/browser_emu.py gc_dialer/gcbackend.py gc_dialer/gc_dialer.py | grep -v 'browser_emu' | grep -v 'gcbackend' | grep -v "#!" >> build/usr/local/bin/gc_dialer.py
 chmod 755 build/usr/local/bin/gc_dialer.py
diff --git a/gc_dialer/build_script.sh b/gc_dialer/build_script.sh
deleted file mode 100755 (executable)
index 41e3235..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# Create PyPackager directory structure from the original files
-# Please make sure the following files are in this directory before
-# running this script
-
-# gc_dialer_256.png
-# gc_dialer_64.png
-# gc_dialer_26.png
-# gc_dialer.py
-# gc_dialer.xml
-# gc_dialer.desktop
-# gcbackend.py
-# browser_emu.py
-
-# The script creates the directories and concatenates the .py into a
-# single python script
-
-mkdir -p build/usr/share/icons/hicolor/scalable/hildon
-mkdir -p build/usr/share/icons/hicolor/26x26/hildon
-mkdir -p build/usr/share/icons/hicolor/64x64/hildon
-mkdir -p build/usr/share/applications/hildon
-mkdir -p build/usr/local/bin
-mkdir -p build/usr/local/lib
-
-cp gc_dialer_256.png build/usr/share/icons/hicolor/scalable/hildon/gc_dialer.png
-cp gc_dialer_64.png  build/usr/share/icons/hicolor/64x64/hildon/gc_dialer.png
-cp gc_dialer_26.png  build/usr/share/icons/hicolor/26x26/hildon/gc_dialer.png
-
-cp gc_dialer.desktop build/usr/share/applications/hildon
-
-cp gc_dialer.xml     build/usr/local/lib
-
-# Compress whitespace for 30% savings, make sure we are a HildonWindow
-sed -i 's/^[ \t]*//;s/[ \t]*$//;s/GtkWindow/HildonWindow/' build/usr/local/lib/gc_dialer.xml
-
-echo "#!/usr/bin/python2.5" > build/usr/local/bin/gc_dialer.py
-#echo "from __future__ import with_statement" >> build/usr/local/bin/gc_dialer.py
-cat gc_dialer.py gcbackend.py browser_emu.py | grep -e '^import ' | sort -u >> build/usr/local/bin/gc_dialer.py
-echo "import hildon" >> build/usr/local/bin/gc_dialer.py
-cat browser_emu.py gcbackend.py gc_dialer.py | grep -v 'browser_emu' | grep -v 'gcbackend' | grep -v "#!" >> build/usr/local/bin/gc_dialer.py
-chmod 755 build/usr/local/bin/gc_dialer.py
index a7667e9..37cf6cd 100755 (executable)
@@ -104,6 +104,7 @@ class Dialpad(object):
                self.prettynumber = ""
                self.areacode = "518"
                self.gcd = GCDialer()
+               self.clipboard = gtk.clipboard_get()
                self.wTree = gtk.Builder()
 
                for path in [ './gc_dialer.xml',
@@ -254,6 +255,11 @@ class Dialpad(object):
                self.error_dialog = error_dialog
                error_dialog.run()
 
+       def on_paste(self, data=None):
+               contents = self.clipboard.wait_for_text()
+               phoneNumber = re.sub('\D', '', contents)
+               self.setNumber(phoneNumber)
+       
        def on_loginbutton_clicked(self, data=None):
                self.wTree.get_object("login_dialog").response(gtk.RESPONSE_OK)
 
@@ -311,15 +317,21 @@ def run_dialpad():
        sys.exit(1)
 
 
+class DummyOptions(object):
+       def __init__(self):
+               self.test = False
+
+
 if __name__ == "__main__":
        try:
                parser = optparse.OptionParser()
                parser.add_option("-t", "--test", action="store_true", dest="test", help="Run tests")
                (options, args) = parser.parse_args()
-
-               if options.test:
-                       run_doctest()
-               else:
-                       run_dialpad()
        except:
+               args = []
+               options = DummyOptions()
+
+       if options.test:
+               run_doctest()
+       else:
                run_dialpad()
index 9ce3d92..4575ae7 100644 (file)
@@ -206,10 +206,8 @@ class GCDialer(object):
 
        def get_recent(self):
                try:
-                       retval = []
                        self._lastData = self._browser.download(GCDialer._inboxallURL)
                        for match in self._inboxRe.finditer(self._lastData):
-                               retval.append([match.group(4), "%s on %s from/to %s - %s" % (match.group(1).capitalize(), match.group(2), match.group(3), match.group(4))])
-                       return retval
+                               yield (match.group(4), "%s on %s from/to %s - %s" % (match.group(1).capitalize(), match.group(2), match.group(3), match.group(4)))
                except:
-                       return []
+                       pass