Author: glen                         Date: Tue Nov  3 09:25:54 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add KDE3/KDE4 protocol handler: kde-protocol-skype; rel 2

---- Files affected:
packages/python-skype:
   python-skype.spec (1.4 -> 1.5) , skype.protocol (NONE -> 1.1)  (NEW), 
skype.py (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/python-skype/python-skype.spec
diff -u packages/python-skype/python-skype.spec:1.4 
packages/python-skype/python-skype.spec:1.5
--- packages/python-skype/python-skype.spec:1.4 Tue Nov  3 10:09:08 2009
+++ packages/python-skype/python-skype.spec     Tue Nov  3 10:25:49 2009
@@ -3,12 +3,14 @@
 Summary:       Python wrapper for the Skype API
 Name:          python-%{module}
 Version:       1.0.31.0
-Release:       1
+Release:       2
 License:       BSD
 Group:         Development/Languages/Python
 Source0:       http://dl.sourceforge.net/skype4py/Skype4Py-%{version}.tar.gz
 # Source0-md5: 13091fccca8160e3e51ec064f42c82fd
 Source1:       %{name}-chat.py
+Source2:       skype.protocol
+Source3:       skype.py
 URL:           https://developer.skype.com/wiki/Skype4Py
 BuildRequires: python-devel
 BuildRequires: rpm-pythonprov
@@ -17,11 +19,22 @@
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                kde_servicesdir %{_datadir}/services
+
 %description
 Skype4Py is a Python wrapper for the Skype API. It is platform
 independant, written completly in Python and reimplements the
 Skype4COM's API in a pythonic way.
 
+%package -n kde-protocol-skype
+Summary:       KDE3/KDE4 protocol handler
+Group:         Applications/Communications
+Requires:      python-skype
+Requires:      skype
+
+%description -n kde-protocol-skype
+KDE3/KDE4 "skype:" protocol handler.
+
 %prep
 %setup -q -n Skype4Py-%{version}
 cp -a %{SOURCE1} chat.py
@@ -38,6 +51,10 @@
 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
 %py_postclean
 
+install -d $RPM_BUILD_ROOT{%{kde_servicesdir},%{_datadir}/skype}
+cp -a %{SOURCE2} $RPM_BUILD_ROOT%{kde_servicesdir}
+install -p %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/skype
+
 # ???
 rm -f $RPM_BUILD_ROOT%{py_sitescriptdir}/Skype4Py/Languages/x1.py[co]
 
@@ -85,12 +102,20 @@
 
 %{py_sitescriptdir}/Skype4Py-*.egg-info
 
+%files -n kde-protocol-skype
+%defattr(644,root,root,755)
+%{kde_servicesdir}/skype.protocol
+%attr(755,root,root) %{_datadir}/skype/skype.py
+
 %define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <[email protected]>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.5  2009/11/03 09:25:49  glen
+- add KDE3/KDE4 protocol handler: kde-protocol-skype; rel 2
+
 Revision 1.4  2009/11/03 09:09:08  glen
 - rel 1
 

================================================================
Index: packages/python-skype/skype.protocol
diff -u /dev/null packages/python-skype/skype.protocol:1.1
--- /dev/null   Tue Nov  3 10:25:54 2009
+++ packages/python-skype/skype.protocol        Tue Nov  3 10:25:49 2009
@@ -0,0 +1,11 @@
+[Protocol]
+exec=/home/glen/skype.py "%u"
+protocol=skype
+input=none
+output=none
+helper=true
+listing=false
+reading=false
+writing=false
+makedir=false
+deleting=false

================================================================
Index: packages/python-skype/skype.py
diff -u /dev/null packages/python-skype/skype.py:1.1
--- /dev/null   Tue Nov  3 10:25:54 2009
+++ packages/python-skype/skype.py      Tue Nov  3 10:25:49 2009
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+# 
---------------------------------------------------------------------------------------------
+#  Python / Skype4Py example that takes a skypename from command line 
parameter,
+#  checks if that skypename is in contact list and if yes then starts a chat 
to that skypename.
+#
+#  Tested with  Skype4Py version 1.0.31.0 and Skype verson 2.0.0.72
+
+import sys
+import Skype4Py
+
+# Let's see if we were started with a command line parameter..
+try:
+    CmdLine = sys.argv[1]
+except:
+    print 'Missing command line parameter'
+    sys.exit()
+
+# strip skype: prefix
+if CmdLine[:6] == "skype:":
+       CmdLine = CmdLine[6:]
+
+# Creating Skype object and assigning event handlers..
+skype = Skype4Py.Skype()
+
+# Starting Skype if it's not running already..
+if not skype.Client.IsRunning:
+    print 'Starting Skype..'
+    skype.Client.Start()
+
+# Attatching to Skype..
+print 'Connecting to Skype..'
+skype.Attach()
+
+# Checking if what we got from command line parameter is present in our 
contact list
+Found = False
+for F in skype.Friends:
+    if F.Handle == CmdLine:
+        Found = True
+        print 'Chatting ' + F.Handle + '..'
+        chat = skype.CreateChatWith(CmdLine);
+        chat.OpenWindow()
+        break
+
+if not Found:
+    print 'Call target not found in contact list'
+    sys.exit()
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python-skype/python-skype.spec?r1=1.4&r2=1.5&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to