Author: jerome
Date: 2009-03-11 21:41:56 +0100 (Wed, 11 Mar 2009)
New Revision: 3968

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py
   
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/resources/gadget.pot
Log:
* Updated pot file.
* Set user parameters from env.
* Added an exception strating skype while having skype instance started.

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py
   2009-03-11 20:23:45 UTC (rev 3967)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py
   2009-03-11 20:41:56 UTC (rev 3968)
@@ -64,27 +64,33 @@
      #Users gadget parameters.
      speaker = "Ryan"
      pitch = 120
+     ip = "127.0.0.1"
      startSkype = True
+     
+     #Geting right gadget parameters.
      if "tgp_startSkype" in os.environ:
          startSkype = os.environ["tgp_startSkype"]
-     else:
-         print("Error: not in environ")
+     if "tgp_ip" in os.environ:
+         ip = os.environ["tgp_ip"]
+     if "tgp_locutor" in os.environ:
+         speaker = os.environ["tgp_locutor"]
+     if "tgp_pitch" in os.environ:
+         pitch = int(os.environ["tgp_pitch"])
 
 
      def __init__(self):
         '''
         Constructor
         '''
-        
-        if self.startSkype:
-            self.__startSkype()
+        print("Debug: connecting")
             
-        self.__tux = TuxAPI("127.0.0.1", 270)
-        self.__tux.server.autoConnect(TuxAPIConst.CLIENT_LEVEL_FREE, 
"SkypeGadget", "tuxdroid-skype-gadget")
+        self.__tux = TuxAPI(self.ip, 270)
+        self.__tux.server.autoConnect(TuxAPIConst.CLIENT_LEVEL_FREE, 
"SkypeGadget", "tuxdroid-gadget-skype")
         self.__tux.server.waitConnected(3.0)
         self.__tux.access.waitAcquire(3.0, ACCESS_PRIORITY_NORMAL)
         t = threading.Thread(target = self.__start, args = [])
         t.start()
+        
 
 
 #########################################################
@@ -97,6 +103,10 @@
          try:
             #Get skype aplication state
             if not self.__getSkypeConnected():
+            
+                if self.startSkype:
+                    self.__startSkype()
+                    
                 time.sleep(1)
                 t = threading.Thread(target = self.__start, args = [])
                 t.start()
@@ -111,6 +121,7 @@
             self.__skype.Attach()
             self.__initSkypeGadget()
             self.__initTuxCallbacks()
+            print("Debug: connected")
          except:
             time.sleep(1)
             t = threading.Thread(target = self.__start, args = [])
@@ -277,11 +288,12 @@
         '''
         This function starts skype.
         '''
+        #Return if skype is already started.
+        if self.__getSkypeConnected():
+            return
+            
         cmd = ["skype", ]
-        process = subprocess.Popen(cmd, stdin=subprocess.PIPE, 
stdout=subprocess.PIPE)
-        ret = process.stdout.read()
-        ret = ret.split();
-        print(ret)
+        subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
 
 
 
@@ -367,9 +379,7 @@
          '''
          Set outgoing calls functions.
          '''
-         print(Status)
          if Status in [Skype4Py.clsFinished, Skype4Py.clsCancelled, 
Skype4Py.clsRefused, Skype4Py.clsFailed, Skype4Py.clsUnplaced]:
-             print(Status)
              self.__currentCall = None
              self.__resetTuxMotors()
              self.__initTuxCallbacks()

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/resources/gadget.pot
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/resources/gadget.pot
   2009-03-11 20:23:45 UTC (rev 3967)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/resources/gadget.pot
   2009-03-11 20:41:56 UTC (rev 3968)
@@ -7,8 +7,8 @@
 msgid "Start skype with the gadget"
 msgstr ""
 
-msgid "connecting to skype"
+msgid "connecting"
 msgstr ""
 
-msgid "connecting to skype"
+msgid "connected"
 msgstr ""


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to