summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL302
-rw-r--r--Makefile.am6
-rw-r--r--configure.in20
-rw-r--r--data/Makefile.am4
-rw-r--r--data/org.freedesktop.Telepathy.ConnectionManager.gadu.service.in3
-rw-r--r--data/org.freedesktop.Telepathy.ConnectionManager.sunshine.service.in3
-rw-r--r--data/sunshine.manager (renamed from data/gadu.manager)6
-rw-r--r--gadu/channel/media.py230
-rwxr-xr-xgadu/lqsoft/ggclient/simple_client.glade399
-rwxr-xr-xgadu/lqsoft/ggclient/simple_client.py215
-rwxr-xr-xgadu/lqsoft/pygadu/network.py9
-rw-r--r--gadu/lqsoft/utils/Makefile.am2
-rw-r--r--gadu/util/__init__.py0
-rw-r--r--sunshine/Makefile.am (renamed from gadu/Makefile.am)4
-rw-r--r--sunshine/__init__.py (renamed from gadu/__init__.py)0
-rw-r--r--sunshine/aliasing.py (renamed from gadu/aliasing.py)18
-rw-r--r--sunshine/avatars.py (renamed from gadu/avatars.py)14
-rw-r--r--sunshine/capabilities.py (renamed from gadu/capabilities.py)12
-rw-r--r--sunshine/channel/Makefile.am (renamed from gadu/channel/Makefile.am)3
-rw-r--r--sunshine/channel/__init__.py (renamed from gadu/channel/__init__.py)2
-rw-r--r--sunshine/channel/contact_list.py (renamed from gadu/channel/contact_list.py)29
-rw-r--r--sunshine/channel/group.py (renamed from gadu/channel/group.py)22
-rw-r--r--sunshine/channel/text.py (renamed from gadu/channel/text.py)12
-rw-r--r--sunshine/channel_manager.py (renamed from gadu/channel_manager.py)24
-rw-r--r--sunshine/connection.py (renamed from gadu/connection.py)72
-rw-r--r--sunshine/connection_manager.py (renamed from gadu/connection_manager.py)16
-rw-r--r--sunshine/contacts.py (renamed from gadu/contacts.py)18
-rw-r--r--sunshine/debug.py (renamed from gadu/debug.py)10
-rw-r--r--sunshine/handle.py (renamed from gadu/handle.py)40
-rw-r--r--sunshine/lqsoft/Makefile.am (renamed from gadu/lqsoft/Makefile.am)2
-rwxr-xr-xsunshine/lqsoft/__init__.py (renamed from gadu/lqsoft/__init__.py)0
-rw-r--r--sunshine/lqsoft/cstruct/Makefile.am (renamed from gadu/lqsoft/cstruct/Makefile.am)2
-rwxr-xr-xsunshine/lqsoft/cstruct/__init__.py (renamed from gadu/lqsoft/cstruct/__init__.py)0
-rwxr-xr-xsunshine/lqsoft/cstruct/common.py (renamed from gadu/lqsoft/cstruct/common.py)2
-rw-r--r--sunshine/lqsoft/cstruct/constraints.py (renamed from gadu/lqsoft/cstruct/constraints.py)0
-rw-r--r--sunshine/lqsoft/cstruct/fields/Makefile.am (renamed from gadu/lqsoft/cstruct/fields/Makefile.am)2
-rwxr-xr-xsunshine/lqsoft/cstruct/fields/__init__.py (renamed from gadu/lqsoft/cstruct/fields/__init__.py)0
-rw-r--r--sunshine/lqsoft/cstruct/fields/complex.py (renamed from gadu/lqsoft/cstruct/fields/complex.py)4
-rwxr-xr-xsunshine/lqsoft/cstruct/fields/numeric.py (renamed from gadu/lqsoft/cstruct/fields/numeric.py)4
-rwxr-xr-xsunshine/lqsoft/cstruct/fields/text.py (renamed from gadu/lqsoft/cstruct/fields/text.py)8
-rw-r--r--sunshine/lqsoft/cstruct/test/Makefile.am (renamed from gadu/lqsoft/cstruct/test/Makefile.am)2
-rwxr-xr-xsunshine/lqsoft/cstruct/test/__init__.py (renamed from gadu/lqsoft/cstruct/test/__init__.py)0
-rwxr-xr-xsunshine/lqsoft/cstruct/test/test_complex.py (renamed from gadu/lqsoft/cstruct/test/test_complex.py)0
-rwxr-xr-xsunshine/lqsoft/cstruct/test/test_numeric.py (renamed from gadu/lqsoft/cstruct/test/test_numeric.py)0
-rwxr-xr-xsunshine/lqsoft/cstruct/test/test_strings.py (renamed from gadu/lqsoft/cstruct/test/test_strings.py)0
-rw-r--r--sunshine/lqsoft/pygadu/Makefile.am (renamed from gadu/lqsoft/pygadu/Makefile.am)2
-rwxr-xr-xsunshine/lqsoft/pygadu/__init__.py (renamed from gadu/lqsoft/ggclient/__init__.py)0
-rwxr-xr-xsunshine/lqsoft/pygadu/models.py (renamed from gadu/lqsoft/pygadu/models.py)2
-rwxr-xr-xsunshine/lqsoft/pygadu/network.py9
-rwxr-xr-xsunshine/lqsoft/pygadu/network_base.py (renamed from gadu/lqsoft/pygadu/network_base.py)8
-rwxr-xr-xsunshine/lqsoft/pygadu/network_v8.py (renamed from gadu/lqsoft/pygadu/network_v8.py)16
-rwxr-xr-xsunshine/lqsoft/pygadu/packets.py (renamed from gadu/lqsoft/pygadu/packets.py)0
-rwxr-xr-xsunshine/lqsoft/pygadu/twisted_protocol.py (renamed from gadu/lqsoft/pygadu/twisted_protocol.py)4
-rw-r--r--sunshine/lqsoft/utils/Makefile.am2
-rwxr-xr-xsunshine/lqsoft/utils/__init__.py (renamed from gadu/lqsoft/utils/__init__.py)0
-rw-r--r--sunshine/presence.py (renamed from gadu/presence.py)78
-rw-r--r--sunshine/util/Makefile.am (renamed from gadu/util/Makefile.am)2
-rw-r--r--[-rwxr-xr-x]sunshine/util/__init__.py (renamed from gadu/lqsoft/pygadu/__init__.py)0
-rw-r--r--sunshine/util/decorator.py (renamed from gadu/util/decorator.py)0
-rwxr-xr-xtelepathy-sunshine (renamed from telepathy-gadu)18
60 files changed, 554 insertions, 1108 deletions
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..2550dab
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,302 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *Note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
index 71ab32c..4311067 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = data gadu
+SUBDIRS = data sunshine
-libexec_SCRIPTS = telepathy-gadu
+libexec_SCRIPTS = telepathy-sunshine
-EXTRA_DIST = telepathy-gadu
+EXTRA_DIST = telepathy-sunshine
diff --git a/configure.in b/configure.in
index 68c1f54..e68088f 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-AC_INIT(telepathy-gadu, 0.1.3)
+AC_INIT(telepathy-sunshine, 0.1.4)
AM_INIT_AUTOMAKE
AM_PATH_PYTHON(2.4)
@@ -6,13 +6,13 @@ AM_PATH_PYTHON(2.4)
AC_OUTPUT([
Makefile
data/Makefile
-gadu/lqsoft/Makefile
-gadu/lqsoft/cstruct/Makefile
-gadu/lqsoft/cstruct/fields/Makefile
-gadu/lqsoft/cstruct/test/Makefile
-gadu/lqsoft/pygadu/Makefile
-gadu/lqsoft/utils/Makefile
-gadu/Makefile
-gadu/util/Makefile
-gadu/channel/Makefile
+sunshine/lqsoft/Makefile
+sunshine/lqsoft/cstruct/Makefile
+sunshine/lqsoft/cstruct/fields/Makefile
+sunshine/lqsoft/cstruct/test/Makefile
+sunshine/lqsoft/pygadu/Makefile
+sunshine/lqsoft/utils/Makefile
+sunshine/Makefile
+sunshine/util/Makefile
+sunshine/channel/Makefile
])
diff --git a/data/Makefile.am b/data/Makefile.am
index e036ee5..3e817c6 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,8 +1,8 @@
managerdir = $(datadir)/telepathy/managers
-manager_DATA = gadu.manager
+manager_DATA = sunshine.manager
servicedir = $(datadir)/dbus-1/services
-service_in_files = org.freedesktop.Telepathy.ConnectionManager.gadu.service.in
+service_in_files = org.freedesktop.Telepathy.ConnectionManager.sunshine.service.in
service_DATA = $(service_in_files:.service.in=.service)
$(service_DATA): $(service_in_files) Makefile
diff --git a/data/org.freedesktop.Telepathy.ConnectionManager.gadu.service.in b/data/org.freedesktop.Telepathy.ConnectionManager.gadu.service.in
deleted file mode 100644
index 17fb18d..0000000
--- a/data/org.freedesktop.Telepathy.ConnectionManager.gadu.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.Telepathy.ConnectionManager.gadu
-Exec=@LIBEXECDIR@/telepathy-gadu
diff --git a/data/org.freedesktop.Telepathy.ConnectionManager.sunshine.service.in b/data/org.freedesktop.Telepathy.ConnectionManager.sunshine.service.in
new file mode 100644
index 0000000..334d3ab
--- /dev/null
+++ b/data/org.freedesktop.Telepathy.ConnectionManager.sunshine.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.Telepathy.ConnectionManager.sunshine
+Exec=@LIBEXECDIR@/telepathy-sunshine
diff --git a/data/gadu.manager b/data/sunshine.manager
index 87faa62..dbcf1de 100644
--- a/data/gadu.manager
+++ b/data/sunshine.manager
@@ -1,7 +1,7 @@
[ConnectionManager]
-Name = gadu
-BusName = org.freedesktop.Telepathy.ConnectionManager.gadu
-ObjectPath = /org/freedesktop/Telepathy/ConnectionManager/gadu
+Name = sunshine
+BusName = org.freedesktop.Telepathy.ConnectionManager.sunshine
+ObjectPath = /org/freedesktop/Telepathy/ConnectionManager/sunshine
[Protocol gadugadu]
param-account = s required
diff --git a/gadu/channel/media.py b/gadu/channel/media.py
deleted file mode 100644
index 0124c6f..0000000
--- a/gadu/channel/media.py
+++ /dev/null
@@ -1,230 +0,0 @@
-# telepathy-butterfly - an MSN connection manager for Telepathy
-#
-# Copyright (C) 2009 Collabora Ltd.
-#
-# 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, or
-# (at your option) any later version.
-#
-# This program 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 program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import logging
-import weakref
-import dbus
-
-import telepathy
-import papyon
-import papyon.event
-
-from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
-from butterfly.media import ButterflySessionHandler
-
-from telepathy.interfaces import CHANNEL_INTERFACE, CHANNEL_INTERFACE_GROUP
-
-__all__ = ['ButterflyMediaChannel']
-
-logger = logging.getLogger('Butterfly.MediaChannel')
-
-
-class ButterflyMediaChannel(
- telepathy.server.ChannelTypeStreamedMedia,
- telepathy.server.ChannelInterfaceCallState,
- telepathy.server.ChannelInterfaceGroup,
- telepathy.server.ChannelInterfaceMediaSignalling,
- papyon.event.CallEventInterface,
- papyon.event.ContactEventInterface,
- papyon.event.MediaSessionEventInterface):
-
- def __init__(self, conn, manager, call, handle, props):
- telepathy.server.ChannelTypeStreamedMedia.__init__(self, conn, manager, props)
- telepathy.server.ChannelInterfaceCallState.__init__(self)
- telepathy.server.ChannelInterfaceGroup.__init__(self)
- telepathy.server.ChannelInterfaceMediaSignalling.__init__(self)
- papyon.event.CallEventInterface.__init__(self, call)
- papyon.event.ContactEventInterface.__init__(self, conn.msn_client)
- papyon.event.MediaSessionEventInterface.__init__(self, call.media_session)
-
- self._call = call
- self._handle = handle
-
- self._implement_property_get(CHANNEL_INTERFACE, {
- 'InitiatorHandle': lambda: dbus.UInt32(self._initiator.id),
- 'InitiatorID': lambda: self._initiator.name
- })
-
- self._implement_property_get(CHANNEL_INTERFACE_GROUP,
- {'LocalPendingMembers': lambda: self.GetLocalPendingMembersWithInfo() })
-
- self._add_immutables({
- 'InitiatorHandle': CHANNEL_INTERFACE,
- 'InitiatorID': CHANNEL_INTERFACE,
- })
-
- if CHANNEL_INTERFACE + '.InitiatorHandle' in props:
- self._initiator = conn.handle(telepathy.HANDLE_TYPE_CONTACT,
- props[CHANNEL_INTERFACE + '.InitiatorHandle'])
- elif CHANNEL_INTERFACE + '.InitiatorID' in props:
- self._initiator = ButterflyHandleFactory(conn, 'contact',
- id=props[CHANNEL_INTERFACE + '.InitiatorHandle'])
- else:
- logger.warning('InitiatorID or InitiatorHandle not set on new channel')
- self._initiator = None
-
- self._session_handler = ButterflySessionHandler(self._conn, self, call.media_session)
-
- flags = (telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE |
- telepathy.CHANNEL_GROUP_FLAG_MESSAGE_REMOVE |
- telepathy.CHANNEL_GROUP_FLAG_MESSAGE_REJECT)
- self.GroupFlagsChanged(flags, 0)
- self.__add_initial_participants()
-
- def Close(self):
- logger.info("Channel closed by client")
- self._call.end()
-
- def GetSessionHandlers(self):
- return [(self._session_handler, self._session_handler.subtype)]
-
- def ListStreams(self):
- logger.info("List streams")
- streams = dbus.Array([], signature="a(uuuuuu)")
- for handler in self._session_handler.ListStreams():
- streams.append((handler.id, self._handle, handler.type,
- handler.state, handler.direction, handler.pending_send))
- return streams
-
- def RequestStreams(self, handle, types):
- logger.info("Request streams %r %r %r" % (handle, self._handle, types))
- if self._handle.get_id() == 0:
- self._handle = self._conn.handle(telepathy.HANDLE_TYPE_CONTACT, handle)
-
- streams = dbus.Array([], signature="a(uuuuuu)")
- for type in types:
- handler = self._session_handler.CreateStream(type, 3)
- handler.connect("state-changed", self.on_stream_state_changed)
- handler.connect("error", self.on_stream_error)
- streams.append((handler.id, self._handle, handler.type,
- handler.state, handler.direction, handler.pending_send))
- self._call.invite()
- return streams
-
- def RequestStreamDirection(self, id, direction):
- logger.info("Request stream direction %r %r" % (id, direction))
- # FIXME: Need to implement changing the stream direction
- #self._session_handler.GetStream(id).direction = direction
-
- def RemoveStreams(self, streams):
- logger.info("Remove streams %r" % streams)
- for id in streams:
- self._session_handler.RemoveStream(id)
- if not self._session_handler.HasStreams():
- self.Close()
-
- def GetSelfHandle(self):
- return self._conn.GetSelfHandle()
-
- def GetLocalPendingMembersWithInfo(self):
- info = dbus.Array([], signature="(uuus)")
- for member in self._local_pending:
- info.append((member, self._handle, 0, ''))
- return info
-
- def AddMembers(self, handles, message):
- logger.info("Add members %r: %s" % (handles, message))
- for handle in handles:
- print handle, self.GetSelfHandle()
- if handle == int(self.GetSelfHandle()):
- if self.GetSelfHandle() in self._local_pending:
- self._call.accept()
-
- def RemoveMembers(self, handles, message):
- logger.info("Remove members %r: %s" % (handles, message))
-
- def RemoveMembersWithReason(self, handles, message, reason):
- logger.info("Remove members %r: %s (%i)" % (handles, message, reason))
-
- #papyon.event.call.CallEventInterface
- def on_call_accepted(self):
- self.on_call_answered(telepathy.MEDIA_STREAM_DIRECTION_BIDIRECTIONAL, 0)
-
- #papyon.event.call.CallEventInterface
- def on_call_rejected(self, response):
- self.on_call_answered(telepathy.MEDIA_STREAM_DIRECTION_NONE, 0)
-
- def on_call_answered(self, direction, pending_send):
- for handler in self._session_handler.ListStreams():
- handler.set_direction(direction, pending_send)
- self.StreamDirectionChanged(handler.id, direction, pending_send)
-
- #papyon.event.call.CallEventInterface
- def on_call_ended(self):
- logger.info("Call has ended")
- telepathy.server.ChannelTypeStreamedMedia.Close(self)
- self.remove_from_connection()
- self._session_handler.remove_from_connection()
-
- #papyon.event.media.MediaSessionEventInterface
- def on_stream_created(self, stream):
- if stream.created_locally:
- return # Stream handler is already existing
-
- logger.info("Media Stream created upon peer request")
- handler = self._session_handler.HandleStream(stream)
- handler.connect("state-changed", self.on_stream_state_changed)
- handler.connect("error", self.on_stream_error)
-
- #papyon.event.media.MediaSessionEventInterface
- def on_stream_added(self, stream):
- handler = self._session_handler.NewStream(stream)
- logger.info("Media Stream %i added" % handler.id)
- self.StreamAdded(handler.id, self._handle, handler.type)
- self.StreamDirectionChanged(handler.id, handler.direction,
- handler.pending_send)
-
- #papyon.event.media.MediaSessionEventInterface
- def on_stream_removed(self, stream):
- handler = self._session_handler.FindStream(stream)
- logger.info("Media Stream %i removed" % handler.id)
- self._session_handler.RemoveStream(handler.id)
- del handler
-
- #papyon.event.media.ContactEventInterface
- def on_contact_presence_changed(self, contact):
- if contact == self._call.peer and \
- contact.presence == papyon.Presence.OFFLINE:
- logger.info("%s is now offline, closing channel" % contact)
- self.Close()
-
- #StreamHandler event
- def on_stream_error(self, handler, error, message):
- self.StreamError(handler.id, error, message)
- self._call.media_session.remove_stream(handler.stream)
-
- #StreamHandler event
- def on_stream_state_changed(self, handler, state):
- self.StreamStateChanged(handler.id, state)
-
- def __add_initial_participants(self):
- added = []
- local_pending = []
- remote_pending = []
-
- if self._call.incoming:
- local_pending.append(self._conn.GetSelfHandle())
- added.append(self._handle)
- else:
- remote_pending.append(self._handle)
- added.append(self._conn.GetSelfHandle())
-
- self.MembersChanged('', added, [], local_pending, remote_pending,
- 0, telepathy.CHANNEL_GROUP_CHANGE_REASON_NONE)
- self._call.ring()
diff --git a/gadu/lqsoft/ggclient/simple_client.glade b/gadu/lqsoft/ggclient/simple_client.glade
deleted file mode 100755
index 3edebac..0000000
--- a/gadu/lqsoft/ggclient/simple_client.glade
+++ /dev/null
@@ -1,399 +0,0 @@
-<?xml version="1.0"?>
-<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkIconFactory" id="StatusIcons">
- <sources>
- <source stock-id="Availble" filename="availble_icon.png"/>
- </sources>
- </object>
- <object class="GtkWindow" id="ChatWindow">
- <property name="width_request">600</property>
- <property name="height_request">400</property>
- <property name="title" translatable="yes">Simple Gadu Client</property>
- <property name="window_position">center</property>
- <property name="default_width">700</property>
- <property name="default_height">400</property>
- <property name="icon_name">SimpleGadu</property>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">1</property>
- <child>
- <object class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkTextView" id="message_view">
- <property name="width_request">500</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="justification">fill</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox1">
- <property name="width_request">150</property>
- <property name="visible">True</property>
- <child>
- <object class="GtkEntry" id="message_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_frame">False</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="send_button">
- <property name="label" translatable="yes">Wy&#x15B;lij wiadomo&#x15B;&#x107;</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked" handler="on_send_button_clicked"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkStatusbar" id="main_statusbar">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkDialog" id="LoginDialog">
- <property name="border_width">5</property>
- <property name="modal">True</property>
- <property name="type_hint">normal</property>
- <property name="deletable">False</property>
- <signal name="response" handler="on_LoginDialog_response"/>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Numer GG:</property>
- <property name="single_line_mode">True</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="uin_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Has&#x142;o:</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="password_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="login_button">
- <property name="label">gtk-connect</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="cancel_button">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="2">login_button</action-widget>
- <action-widget response="1">cancel_button</action-widget>
- </action-widgets>
- </object>
- <object class="GtkTreeStore" id="ContactTree">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- <!-- column-name status -->
- <column type="gint"/>
- <!-- column-name isGroup -->
- <column type="gboolean"/>
- </columns>
- </object>
- <object class="GtkWindow" id="RoosterWindow">
- <property name="window_position">mouse</property>
- <property name="default_width">200</property>
- <property name="default_height">600</property>
- <accel-groups>
- <group name="accelgroup1"/>
- </accel-groups>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkMenuBar" id="menubar1">
- <property name="visible">True</property>
- <child>
- <object class="GtkMenuItem" id="menuitem1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Po&#x142;&#x105;czenie</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="connection_menu">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu_connect">
- <property name="label">gtk-connect</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <property name="accel_group">accelgroup1</property>
- <signal name="activate" handler="on_menu_connect_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
- <property name="visible">True</property>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menu_quit">
- <property name="label">gtk-quit</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <property name="accel_group">accelgroup1</property>
- <signal name="activate" handler="on_menu_quit_activate"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Pr_ofil</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="profile_menu">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu_import_contacts">
- <property name="label">Importuj Kontakty</property>
- <property name="visible">True</property>
- <property name="image">image1</property>
- <property name="use_stock">False</property>
- <property name="accel_group">accelgroup1</property>
- <signal name="activate" handler="on_menu_import_contacts_activate"/>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="separatormenuitem2">
- <property name="visible">True</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Pomo_c</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu3">
- <property name="visible">True</property>
- <child>
- <object class="GtkImageMenuItem" id="menu_about">
- <property name="label">gtk-about</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <property name="accel_group">accelgroup1</property>
- <signal name="activate" handler="on_menu_about_activate"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkNotebook" id="notebook3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_border">False</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkTreeView" id="ContactTreeView">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="model">ContactTree</property>
- <property name="headers_clickable">False</property>
- <property name="expander_column">expand</property>
- <property name="rules_hint">True</property>
- <property name="enable_search">False</property>
- <property name="level_indentation">20</property>
- <property name="enable_grid_lines">horizontal</property>
- <property name="enable_tree_lines">True</property>
- <child>
- <object class="GtkTreeViewColumn" id="expand">
- <property name="sizing">fixed</property>
- <property name="fixed_width">26</property>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn2">
- <property name="sizing">autosize</property>
- <property name="min_width">100</property>
- <property name="title">Imie</property>
- <property name="sort_indicator">True</property>
- <child>
- <object class="GtkCellRendererText" id="name"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn1">
- <property name="min_width">32</property>
- <property name="title">Status</property>
- <property name="sort_indicator">True</property>
- <child>
- <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
- <property name="stock_id">Availble</property>
- </object>
- <attributes>
- <attribute name="visible">2</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="lablel1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Kontakty</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkStatusbar" id="status_bar">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkAccelGroup" id="accelgroup1"/>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-revert-to-saved</property>
- </object>
-</interface>
diff --git a/gadu/lqsoft/ggclient/simple_client.py b/gadu/lqsoft/ggclient/simple_client.py
deleted file mode 100755
index 995b1bc..0000000
--- a/gadu/lqsoft/ggclient/simple_client.py
+++ /dev/null
@@ -1,215 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8
-
-__author__="lreqc"
-__date__ ="$2009-07-14 01:54:14$"
-
-import gtk
-import xml.etree.ElementTree as ET
-
-from twisted.internet import gtk2reactor
-gtk2reactor.install()
-
-from lqsoft.pygadu.twisted_protocol import GaduClient
-from lqsoft.pygadu.models import GaduProfile, GaduContact
-
-from twisted.internet import reactor, protocol
-from twisted.python import log
-
-import sys
-
-class GaduClientFactory(protocol.ClientFactory):
- def __init__(self, config):
- self.config = config
-
- def buildProtocol(self, addr):
- # connect using current selected profile
- return GaduClient(self.config.profile)
-
- def startedConnecting(self, connector):
- print 'Started to connect.'
-
- def clientConnectionLost(self, connector, reason):
- print 'Lost connection. Reason:', reason
- # protocol.ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
- # connector.connect()
-
- def clientConnectionFailed(self, connector, reason):
- print 'Connection failed. Reason:', reason
- # protocol.ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
- reactor.stop()
-
-class MainApp(object):
-
- def __init__(self, config):
- self.config = config
- self.factory = GaduClientFactory(config)
-
- self.gtk_builder = gtk.Builder();
- self.gtk_builder.add_from_file("simple_client.glade")
-
- self.mainWindow = self.gtk_builder.get_object("RoosterWindow")
- self.mainWindow.connect("destroy", self.onExit)
-
- self.contactTree = self.gtk_builder.get_object("ContactTree")
-
- unconnected = self.gtk_builder.connect_signals({
- 'on_menu_connect_activate': self.connectUser,
- 'on_menu_quit_activate': self.onExit,
- 'on_menu_import_contacts_activate': self.importContacts,
- # 'on_menu_about_activate': self.onAbout,
- })
- print unconnected
-
- # status bar
- #self.statusBar = self.widgetTree.get_widget("main_statusbar")
-
- # extract some widgets
- #self.loginDialog = self.widgetTree.get_widget("LoginDialog")
- #self.loginDialog_uin = self.widgetTree.get_widget("uin_entry")
- #self.loginDialog_pass = self.widgetTree.get_widget("password_entry")
-
- #self.sendButton = self.widgetTree.get_widget("send_button")
- #self.messageEntry = self.widgetTree.get_widget("message_entry")
-
- #tv = self.widgetTree.get_widget("message_view")
- #self.msgBuf = gtk.TextBuffer()
- #tv.set_buffer(self.msgBuf)
-
- self.mainWindow.show()
-
- def onMessageSent(self, widget, data=None):
- self.msgBuf.insert_at_cursor('Hello!\n')
-
- def onExit(self, widget, data=None):
- reactor.stop()
- return True
-
- def connectUser(self, widget, *args):
- """This is called when user selects "connect" from the main menu"""
- # connect some callbacks to the model
- profile = self.config.profile
- profile.onLoginSuccess = self.loginSuccess
- profile.onLoginFailure = self.loginFailed
- profile.onContactStatusChange = self.updateContact
- profile.onMessageReceived = self.messageReceived
-
- statusBar = self.gtk_builder.get_object("status_bar")
-
- self.__status_ctx_id = statusBar.get_context_id("Login status")
- statusBar.push(self.__status_ctx_id, "Authenticating...")
-
- reactor.connectTCP('91.197.13.83', 8074, self.factory)
-
- #self.loginDialog.show()
-
- def importContacts(self, widget, *args):
- txt = """<b>Gżegżółka</b>"""
- # self.config.profile.importContacts(self.refreshContactList)
- self.config.profile.sendTo(1849224, txt)
-
- def refreshContactList(self):
- self.contactTree.clear()
-
- all_g = self.contactTree.append(None, row=("ALL", 0, False) )
-
- for contact in self.config.profile.contacts:
- self.contactTree.append(all_g,\
- row=(contact.ShowName, contact.status, True) )
-
- def loginDialogResponse(self, widget, response_id, *args):
- self.loginDialog.destroy()
-
- if response_id == 2:
- self.profile.uin = int(self.loginDialog_uin.get_text())
- self.profile.password = self.loginDialog_pass.get_text()
-
- statusBar = self.gtk_builder.get_object("status_bar")
-
- statusBar.pop(self.__status_ctx_id)
- statusBar.push(self.__status_ctx_id, "Connecting...")
-
- reactor.connectTCP('91.197.13.83', 8074, self.factory)
- else:
- return False
-
- def loginSuccess(self):
- statusBar = self.gtk_builder.get_object("status_bar")
- statusBar.pop(self.__status_ctx_id)
- statusBar.push(self.__status_ctx_id, "Login done.")
-
- def loginFailed(self):
- statusBar = self.gtk_builder.get_object("status_bar")
-
- statusBar.pop(self.__status_ctx_id)
- statusBar.push(self.__status_ctx_id, "Login done.")
-
- def updateContact(self, contact):
- print contact
-
- def messageReceived(self, msg):
- print "Msg %d %d [%r] [%r]" % (msg.content.offset_plain, msg.content.offset_attrs, msg.content.plain_message, msg.content.html_message)
-
-class Config(object):
-
- def __init__(self, config_file):
- config_xml = ET.parse(config_file)
-
- self.profiles = {}
-
- for profile_xml in config_xml.findall('gadu-profile'):
- profile = GaduProfile(uin= int(profile_xml.find('uin').text) )
- profile.password = profile_xml.find('password').text
-
- for elem in profile_xml.find('Groups').getchildren():
- profile.addContactGroup( GaduContactGroup.from_xml(elem) )
-
- for elem in profile_xml.find('Contacts').getchildren():
- profile.addContact( GaduContact.from_xml(elem) )
-
- self.profiles[profile.uin] = profile
-
- self._default_profile = int(config_xml.find('default-profile').text)
-
-
- @property
- def profile(self):
- return self.profiles[self._default_profile]
-
-if __name__ == '__main__':
- import os
- import os.path
-
- def init_defaults():
- with open(config_path, 'wb+') as config_file:
- config_file.write("""<?xml version='1.0'?>
- <sgc-config>
- <default-profile>0</default-profile>
- <gadu-profile>
- <uin>0<!-- put your GG number here --></uin>
- <password>no_pass<!-- put your password here --></password>
- <Groups />
- <Contacts />
- </gadu-profile>
- </sgc-config>""");
-
-
- # get the config data
- try:
- homedir = os.environ['APPDATA']
- except KeyError:
- homedir = os.environ['HOME']
-
- config_path = os.path.join(homedir, 'sgc_config.xml')
-
- if not os.path.isfile(config_path):
- init_defaults()
-
- config = Config(config_path)
-
- # initialize logging
- log.startLogging(sys.stdout)
-
- # run
- app = MainApp( config )
- reactor.run()
diff --git a/gadu/lqsoft/pygadu/network.py b/gadu/lqsoft/pygadu/network.py
deleted file mode 100755
index 9b23b20..0000000
--- a/gadu/lqsoft/pygadu/network.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8
-#
-
-__author__= "Łukasz Rekucki"
-__date__ = "$2009-07-23 19:35:08$"
-
-
-from gadu.lqsoft.pygadu.network_base import *
-from gadu.lqsoft.pygadu.network_v8 import *
diff --git a/gadu/lqsoft/utils/Makefile.am b/gadu/lqsoft/utils/Makefile.am
deleted file mode 100644
index 71a42e2..0000000
--- a/gadu/lqsoft/utils/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-utilsdir = $(pythondir)/gadu/lqsoft/utils
-utils_PYTHON = __init__.py
diff --git a/gadu/util/__init__.py b/gadu/util/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/gadu/util/__init__.py
+++ /dev/null
diff --git a/gadu/Makefile.am b/sunshine/Makefile.am
index ece166d..ff421e8 100644
--- a/gadu/Makefile.am
+++ b/sunshine/Makefile.am
@@ -1,7 +1,7 @@
SUBDIRS = channel lqsoft util
-gadudir = $(pythondir)/gadu
-gadu_PYTHON = aliasing.py \
+sunshinedir = $(pythondir)/sunshine
+sunshine_PYTHON = aliasing.py \
avatars.py \
capabilities.py \
channel_manager.py \
diff --git a/gadu/__init__.py b/sunshine/__init__.py
index 6c7c92f..6c7c92f 100644
--- a/gadu/__init__.py
+++ b/sunshine/__init__.py
diff --git a/gadu/aliasing.py b/sunshine/aliasing.py
index 77b7f5f..d5fd250 100644
--- a/gadu/aliasing.py
+++ b/sunshine/aliasing.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -22,14 +22,14 @@ import logging
import telepathy
import telepathy.constants
-from gadu.handle import GaduHandleFactory
-from gadu.util.decorator import async
+from sunshine.handle import SunshineHandleFactory
+from sunshine.util.decorator import async
-__all__ = ['GaduAliasing']
+__all__ = ['SunshineAliasing']
-logger = logging.getLogger('Gadu.Aliasing')
+logger = logging.getLogger('Sunshine.Aliasing')
-class GaduAliasing(telepathy.server.ConnectionInterfaceAliasing):
+class SunshineAliasing(telepathy.server.ConnectionInterfaceAliasing):
def __init__(self):
telepathy.server.ConnectionInterfaceAliasing.__init__(self)
@@ -53,7 +53,7 @@ class GaduAliasing(telepathy.server.ConnectionInterfaceAliasing):
def SetAliases(self, aliases):
for handle_id, alias in aliases.iteritems():
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle != GaduHandleFactory(self, 'self'):
+ if handle != SunshineHandleFactory(self, 'self'):
logger.debug("Called SetAliases for handle: %s, alias: %s" % (handle.name, alias))
if alias == handle.name:
@@ -72,7 +72,7 @@ class GaduAliasing(telepathy.server.ConnectionInterfaceAliasing):
self.AliasesChanged([(handle, alias)])
else:
logger.info("Self alias changed to '%s'" % alias)
- self.AliasesChanged(((GaduHandleFactory(self, 'self'), alias), ))
+ self.AliasesChanged(((SunshineHandleFactory(self, 'self'), alias), ))
# # papyon.event.ContactEventInterface
# def on_contact_display_name_changed(self, contact):
@@ -103,7 +103,7 @@ class GaduAliasing(telepathy.server.ConnectionInterfaceAliasing):
def _get_alias(self, handle_id):
"""Get the alias from one handle id"""
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle == GaduHandleFactory(self, 'self'):
+ if handle == SunshineHandleFactory(self, 'self'):
alias = 'Ja'
else:
contact = handle.contact
diff --git a/gadu/avatars.py b/sunshine/avatars.py
index 0a4d147..e230d8f 100644
--- a/gadu/avatars.py
+++ b/sunshine/avatars.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -28,18 +28,18 @@ from twisted.web.client import getPage
from xml.dom import minidom
-from gadu.handle import GaduHandleFactory
-from gadu.util.decorator import async
+from sunshine.handle import SunshineHandleFactory
+from sunshine.util.decorator import async
-__all__ = ['GaduAvatars']
+__all__ = ['SunshineAvatars']
-logger = logging.getLogger('Gadu.Avatars')
+logger = logging.getLogger('Sunshine.Avatars')
-class GaduAvatars(telepathy.server.ConnectionInterfaceAvatars):
+class SunshineAvatars(telepathy.server.ConnectionInterfaceAvatars):
def __init__(self):
- print 'GaduAvatars called.'
+ print 'SunshineAvatars called.'
self._avatar_known = False
telepathy.server.ConnectionInterfaceAvatars.__init__(self)
diff --git a/gadu/capabilities.py b/sunshine/capabilities.py
index c09aefb..92dbd5e 100644
--- a/gadu/capabilities.py
+++ b/sunshine/capabilities.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2009 Collabora Ltd.
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -21,16 +21,14 @@ import logging
import dbus
import telepathy
-#import papyon
-#import papyon.event
-from gadu.handle import GaduHandleFactory
+from sunshine.handle import SunshineHandleFactory
-__all__ = ['GaduCapabilities']
+__all__ = ['SunshineCapabilities']
-logger = logging.getLogger('Gadu.Capabilities')
+logger = logging.getLogger('Sunshine.Capabilities')
-class GaduCapabilities(telepathy.server.ConnectionInterfaceCapabilities):
+class SunshineCapabilities(telepathy.server.ConnectionInterfaceCapabilities):
def __init__(self):
telepathy.server.ConnectionInterfaceCapabilities.__init__(self)
diff --git a/gadu/channel/Makefile.am b/sunshine/channel/Makefile.am
index b27cc35..875550b 100644
--- a/gadu/channel/Makefile.am
+++ b/sunshine/channel/Makefile.am
@@ -1,6 +1,5 @@
-channeldir = $(pythondir)/gadu/channel
+channeldir = $(pythondir)/sunshine/channel
channel_PYTHON = contact_list.py \
group.py \
__init__.py \
- media.py \
text.py
diff --git a/gadu/channel/__init__.py b/sunshine/channel/__init__.py
index 55b7cf0..7a6b8a1 100644
--- a/gadu/channel/__init__.py
+++ b/sunshine/channel/__init__.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
diff --git a/gadu/channel/contact_list.py b/sunshine/channel/contact_list.py
index c4fa28d..31b4a02 100644
--- a/gadu/channel/contact_list.py
+++ b/sunshine/channel/contact_list.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -24,15 +24,15 @@ import telepathy
import xml.etree.ElementTree as ET
-from gadu.util.decorator import async
-from gadu.handle import GaduHandleFactory
+from sunshine.util.decorator import async
+from sunshine.handle import SunshineHandleFactory
-from gadu.lqsoft.pygadu.twisted_protocol import GaduClient
-from gadu.lqsoft.pygadu.models import GaduProfile, GaduContact
+from sunshine.lqsoft.pygadu.twisted_protocol import GaduClient
+from sunshine.lqsoft.pygadu.models import GaduProfile, GaduContact
-__all__ = ['GaduContactListChannelFactory']
+__all__ = ['SunshineContactListChannelFactory']
-logger = logging.getLogger('Gadu.ContactListChannel')
+logger = logging.getLogger('Sunshine.ContactListChannel')
class HandleMutex(object):
def __init__(self):
@@ -95,16 +95,16 @@ class Lockable(object):
mutex = HandleMutex()
-def GaduContactListChannelFactory(connection, manager, handle, props):
+def SunshineContactListChannelFactory(connection, manager, handle, props):
handle = connection.handle(
props[telepathy.CHANNEL_INTERFACE + '.TargetHandleType'],
props[telepathy.CHANNEL_INTERFACE + '.TargetHandle'])
if handle.get_name() == 'subscribe':
- channel_class = GaduSubscribeListChannel
+ channel_class = SunshineSubscribeListChannel
#hacky & tricky
# elif handle.get_name() == 'publish':
-# channel_class = GaduSubscribeListChannel
+# channel_class = SunshineSubscribeListChannel
# elif handle.get_name() == 'publish':
# channel_class = ButterflyPublishListChannel
@@ -119,7 +119,7 @@ def GaduContactListChannelFactory(connection, manager, handle, props):
return channel_class(connection, manager, props)
-class GaduListChannel(
+class SunshineListChannel(
telepathy.server.ChannelTypeContactList,
telepathy.server.ChannelInterfaceGroup):
"Abstract Contact List channels"
@@ -177,7 +177,7 @@ class GaduListChannel(
#logger.info("New contact %s, name: %s added." % (contact.uin, contact.ShowName))
ad, lp, rp = self._filter_contact(contact)
if ad or lp or rp:
- handle = GaduHandleFactory(self._conn_ref(), 'contact',
+ handle = SunshineHandleFactory(self._conn_ref(), 'contact',
contact.uin, None)
if ad: added.add(handle)
if lp: local_pending.add(handle)
@@ -194,7 +194,7 @@ class GaduListChannel(
(handle in remote_pending)
-class GaduSubscribeListChannel(GaduListChannel):
+class SunshineSubscribeListChannel(SunshineListChannel):
"""Subscribe List channel.
This channel contains the list of contact to whom the current used is
@@ -202,8 +202,7 @@ class GaduSubscribeListChannel(GaduListChannel):
supposed to receive presence notification."""
def __init__(self, connection, manager, props):
- GaduListChannel.__init__(self, connection, manager, props)
- #papyon.event.ContactEventInterface.__init__(self, connection.msn_client)
+ SunshineListChannel.__init__(self, connection, manager, props)
self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD |
telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE, 0)
diff --git a/gadu/channel/group.py b/sunshine/channel/group.py
index ca59f1e..6094092 100644
--- a/gadu/channel/group.py
+++ b/sunshine/channel/group.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
@@ -24,25 +24,25 @@ import telepathy
import xml.etree.ElementTree as ET
-from gadu.lqsoft.pygadu.models import GaduProfile, GaduContact, GaduContactGroup
+from sunshine.lqsoft.pygadu.models import GaduProfile, GaduContact, GaduContactGroup
-from gadu.util.decorator import async
-from gadu.handle import GaduHandleFactory
-from gadu.channel.contact_list import GaduListChannel
+from sunshine.util.decorator import async
+from sunshine.handle import SunshineHandleFactory
+from sunshine.channel.contact_list import SunshineListChannel
-__all__ = ['GaduGroupChannel']
+__all__ = ['SunshineGroupChannel']
-logger = logging.getLogger('Gadu.GroupChannel')
+logger = logging.getLogger('Sunshine.GroupChannel')
-class GaduGroupChannel(GaduListChannel):
+class SunshineGroupChannel(SunshineListChannel):
def __init__(self, connection, manager, props):
self.__pending_add = []
self.__pending_remove = []
self.conn = connection
self.groups = {}
- GaduListChannel.__init__(self, connection, manager, props)
+ SunshineListChannel.__init__(self, connection, manager, props)
self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD |
telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE, 0)
@async
@@ -167,7 +167,7 @@ class GaduGroupChannel(GaduListChannel):
else:
contact_uin = contact_handle.name
- handle = GaduHandleFactory(self.conn, 'contact',
+ handle = SunshineHandleFactory(self.conn, 'contact',
contact_uin, None)
added = set()
added.add(handle)
@@ -201,7 +201,7 @@ class GaduGroupChannel(GaduListChannel):
def delete_contact_from_group(self, group, contact, contact_handle):
group_name = group.Name
if group_name == self._handle.name:
- handle = GaduHandleFactory(self.conn, 'contact',
+ handle = SunshineHandleFactory(self.conn, 'contact',
contact.uin, None)
removed = set()
removed.add(handle)
diff --git a/gadu/channel/text.py b/sunshine/channel/text.py
index 1286ece..03ccc9e 100644
--- a/gadu/channel/text.py
+++ b/sunshine/channel/text.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
@@ -24,15 +24,15 @@ import time
import telepathy
-from gadu.util.decorator import async
-from gadu.handle import GaduHandleFactory
+from sunshine.util.decorator import async
+from sunshine.handle import SunshineHandleFactory
-__all__ = ['GaduTextChannel']
+__all__ = ['SunshineTextChannel']
-logger = logging.getLogger('Gadu.TextChannel')
+logger = logging.getLogger('Sunshine.TextChannel')
-class GaduTextChannel(telepathy.server.ChannelTypeText):
+class SunshineTextChannel(telepathy.server.ChannelTypeText):
def __init__(self, conn, manager, conversation, props):
_, surpress_handler, handle = manager._get_type_requested_handle(props)
diff --git a/gadu/channel_manager.py b/sunshine/channel_manager.py
index aa68413..8cff4b9 100644
--- a/gadu/channel_manager.py
+++ b/sunshine/channel_manager.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -23,17 +23,17 @@ import weakref
import dbus
import telepathy
-from gadu.channel.contact_list import GaduContactListChannelFactory
-from gadu.channel.group import GaduGroupChannel
-from gadu.channel.text import GaduTextChannel
-#from butterfly.channel.media import ButterflyMediaChannel
-from gadu.handle import GaduHandleFactory
+from sunshine.channel.contact_list import SunshineContactListChannelFactory
+from sunshine.channel.group import SunshineGroupChannel
+from sunshine.channel.text import SunshineTextChannel
+#from sunshine.channel.media import SunshineMediaChannel
+from sunshine.handle import SunshineHandleFactory
-__all__ = ['GaduChannelManager']
+__all__ = ['SunshineChannelManager']
-logger = logging.getLogger('Gadu.ChannelManager')
+logger = logging.getLogger('Sunshine.ChannelManager')
-class GaduChannelManager(telepathy.server.ChannelManager):
+class SunshineChannelManager(telepathy.server.ChannelManager):
def __init__(self, connection):
telepathy.server.ChannelManager.__init__(self, connection)
@@ -55,10 +55,10 @@ class GaduChannelManager(telepathy.server.ChannelManager):
_, surpress_handler, handle = self._get_type_requested_handle(props)
if handle.get_type() == telepathy.HANDLE_TYPE_GROUP:
- channel = GaduGroupChannel(self._conn, self, props)
+ channel = SunshineGroupChannel(self._conn, self, props)
logger.debug('New group channel')
else:
- channel = GaduContactListChannelFactory(self._conn,
+ channel = SunshineContactListChannelFactory(self._conn,
self, handle, props)
logger.debug('New contact list channel: %s' % (handle.name))
return channel
@@ -71,7 +71,7 @@ class GaduChannelManager(telepathy.server.ChannelManager):
logger.debug('New text channel for handle, name: %s, id: %s, type: %s' % (handle.name, handle.id, handle.type))
- channel = GaduTextChannel(self._conn, self, conversation, props)
+ channel = SunshineTextChannel(self._conn, self, conversation, props)
return channel
# def _get_media_channel(self, props, call=None):
diff --git a/gadu/connection.py b/sunshine/connection.py
index 2756b44..86bd0c4 100644
--- a/gadu/connection.py
+++ b/sunshine/connection.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
#
@@ -24,8 +24,8 @@ import logging
import xml.etree.ElementTree as ET
-from gadu.lqsoft.pygadu.twisted_protocol import GaduClient
-from gadu.lqsoft.pygadu.models import GaduProfile, GaduContact, GaduContactGroup
+from sunshine.lqsoft.pygadu.twisted_protocol import GaduClient
+from sunshine.lqsoft.pygadu.models import GaduProfile, GaduContact, GaduContactGroup
from twisted.internet import reactor, protocol
from twisted.web.client import getPage
@@ -34,28 +34,28 @@ from twisted.python import log
import dbus
import telepathy
-from gadu.presence import GaduPresence
-from gadu.aliasing import GaduAliasing
-from gadu.avatars import GaduAvatars
-from gadu.handle import GaduHandleFactory
-from gadu.capabilities import GaduCapabilities
-from gadu.contacts import GaduContacts
-from gadu.channel_manager import GaduChannelManager
-from gadu.util.decorator import async
+from sunshine.presence import SunshinePresence
+from sunshine.aliasing import SunshineAliasing
+from sunshine.avatars import SunshineAvatars
+from sunshine.handle import SunshineHandleFactory
+from sunshine.capabilities import SunshineCapabilities
+from sunshine.contacts import SunshineContacts
+from sunshine.channel_manager import SunshineChannelManager
+from sunshine.util.decorator import async
-__all__ = ['GaduConnection']
+__all__ = ['SunshineConnection']
-logger = logging.getLogger('Gadu.Connection')
+logger = logging.getLogger('Sunshine.Connection')
-class GaduConfig(object):
+class SunshineConfig(object):
def __init__(self, uin):
self.uin = uin
self.path = None
self.contacts_count = 0
def check_dirs(self):
- path = os.path.join(os.path.join(os.environ['HOME'], '.telepathy-gadu'), str(self.uin))
+ path = os.path.join(os.path.join(os.environ['HOME'], '.telepathy-sunshine'), str(self.uin))
try:
os.makedirs(path)
except:
@@ -146,13 +146,13 @@ class GaduClientFactory(protocol.ClientFactory):
#protocol.ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
reactor.stop()
-class GaduConnection(telepathy.server.Connection,
+class SunshineConnection(telepathy.server.Connection,
telepathy.server.ConnectionInterfaceRequests,
- GaduPresence,
- GaduAliasing,
- GaduAvatars,
- GaduCapabilities,
- GaduContacts
+ SunshinePresence,
+ SunshineAliasing,
+ SunshineAvatars,
+ SunshineCapabilities,
+ SunshineContacts
):
@@ -191,7 +191,7 @@ class GaduConnection(telepathy.server.Connection,
self.profile.onStatusNoticiesRecv = self.on_StatusNoticiesRecv
#lets try to make file with contacts etc ^^
- self.configfile = GaduConfig(int(parameters['account']))
+ self.configfile = SunshineConfig(int(parameters['account']))
self.configfile.check_dirs()
#lets get contacts from contacts config file
contacts_list = self.configfile.get_contacts()
@@ -213,23 +213,23 @@ class GaduConnection(telepathy.server.Connection,
self.factory = GaduClientFactory(self.profile)
- self._channel_manager = GaduChannelManager(self)
+ self._channel_manager = SunshineChannelManager(self)
self._recv_id = 0
self.pending_contacts_to_group = {}
self._status = None
# Call parent initializers
- telepathy.server.Connection.__init__(self, 'gadugadu', account, 'gadu')
+ telepathy.server.Connection.__init__(self, 'gadugadu', account, 'sunshine')
telepathy.server.ConnectionInterfaceRequests.__init__(self)
- GaduPresence.__init__(self)
- GaduAliasing.__init__(self)
- GaduAvatars.__init__(self)
- GaduCapabilities.__init__(self)
- GaduContacts.__init__(self)
+ SunshinePresence.__init__(self)
+ SunshineAliasing.__init__(self)
+ SunshineAvatars.__init__(self)
+ SunshineCapabilities.__init__(self)
+ SunshineContacts.__init__(self)
- self.set_self_handle(GaduHandleFactory(self, 'self'))
+ self.set_self_handle(SunshineHandleFactory(self, 'self'))
self.__disconnect_reason = telepathy.CONNECTION_STATUS_REASON_NONE_SPECIFIED
#small hack. We started to connnect with status invisible and just later we change status to client-like
@@ -307,7 +307,7 @@ class GaduConnection(telepathy.server.Connection,
if handle_id != 0:
handle = self.handle(telepathy.constants.HANDLE_TYPE_CONTACT, handle_id)
else:
- handle = GaduHandleFactory(self, 'contact',
+ handle = SunshineHandleFactory(self, 'contact',
str(contact_name), None)
# try:
@@ -350,9 +350,9 @@ class GaduConnection(telepathy.server.Connection,
#
elif handle_type == telepathy.HANDLE_TYPE_LIST:
- handle = GaduHandleFactory(self, 'list', name)
+ handle = SunshineHandleFactory(self, 'list', name)
elif handle_type == telepathy.HANDLE_TYPE_GROUP:
- handle = GaduHandleFactory(self, 'group', name)
+ handle = SunshineHandleFactory(self, 'group', name)
else:
raise telepathy.NotAvailable('Handle type unsupported %d' % handle_type)
handles.append(handle.id)
@@ -418,7 +418,7 @@ class GaduConnection(telepathy.server.Connection,
@async
def makeTelepathyContactsChannel(self):
logger.debug("Method makeTelepathyContactsChannel called.")
- handle = GaduHandleFactory(self, 'list', 'subscribe')
+ handle = SunshineHandleFactory(self, 'list', 'subscribe')
props = self._generate_props(telepathy.CHANNEL_TYPE_CONTACT_LIST,
handle, False)
self._channel_manager.channel_for_props(props, signal=True)
@@ -432,7 +432,7 @@ class GaduConnection(telepathy.server.Connection,
def makeTelepathyGroupChannels(self):
logger.debug("Method makeTelepathyGroupChannels called.")
for group in self.profile.groups:
- handle = GaduHandleFactory(self, 'group',
+ handle = SunshineHandleFactory(self, 'group',
group.Name)
props = self._generate_props(
telepathy.CHANNEL_TYPE_CONTACT_LIST, handle, False)
@@ -519,7 +519,7 @@ class GaduConnection(telepathy.server.Connection,
if handle_id != 0:
handle = self.handle(telepathy.constants.HANDLE_TYPE_CONTACT, handle_id)
else:
- handle = GaduHandleFactory(self, 'contact',
+ handle = SunshineHandleFactory(self, 'contact',
str(msg.sender), None)
timestamp = int(time.time())
diff --git a/gadu/connection_manager.py b/sunshine/connection_manager.py
index b776530..3a408bd 100644
--- a/gadu/connection_manager.py
+++ b/sunshine/connection_manager.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
#
@@ -21,23 +21,23 @@ import gobject
import dbus
import logging
-from gadu.connection import GaduConnection
+from sunshine.connection import SunshineConnection
-__all__ = ['GaduConnectionManager']
+__all__ = ['SunshineConnectionManager']
-logger = logging.getLogger('Gadu.ConnectionManager')
+logger = logging.getLogger('Sunshine.ConnectionManager')
-class GaduConnectionManager(telepathy.server.ConnectionManager):
- """Gadu connection manager
+class SunshineConnectionManager(telepathy.server.ConnectionManager):
+ """Sunshine connection manager
Implements the org.freedesktop.Telepathy.ConnectionManager interface"""
def __init__(self, shutdown_func=None):
"Initializer"
- telepathy.server.ConnectionManager.__init__(self, 'gadu')
+ telepathy.server.ConnectionManager.__init__(self, 'sunshine')
- self._protos['gadugadu'] = GaduConnection
+ self._protos['gadugadu'] = SunshineConnection
self._shutdown = shutdown_func
logger.info("Connection manager created")
diff --git a/gadu/contacts.py b/sunshine/contacts.py
index 7acc3ab..6dd3d0a 100644
--- a/gadu/contacts.py
+++ b/sunshine/contacts.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2009 Olivier Le Thanh Duong <olivier@lethanh.be>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -23,17 +23,13 @@ import time
import telepathy
import telepathy.errors
-#import papyon
import dbus
-__all__ = ['GaduContacts']
+__all__ = ['SunshineContacts']
-logger = logging.getLogger('Gadu.Contacts')
+logger = logging.getLogger('Sunshine.Contacts')
-class GaduContacts(telepathy.server.ConnectionInterfaceContacts):
-# telepathy.server.ConnectionInterfaceContacts,
-# papyon.event.ContactEventInterface,
-# papyon.event.ProfileEventInterface):
+class SunshineContacts(telepathy.server.ConnectionInterfaceContacts):
attributes = {
telepathy.CONNECTION : 'contact-id',
@@ -45,8 +41,6 @@ class GaduContacts(telepathy.server.ConnectionInterfaceContacts):
def __init__(self):
telepathy.server.ConnectionInterfaceContacts.__init__(self)
-# papyon.event.ContactEventInterface.__init__(self, self.msn_client)
-# papyon.event.ProfileEventInterface.__init__(self, self.msn_client)
dbus_interface = telepathy.CONNECTION_INTERFACE_CONTACTS
@@ -75,8 +69,8 @@ class GaduContacts(telepathy.server.ConnectionInterfaceContacts):
lambda x: self.GetPresences(x).items(),
telepathy.CONNECTION_INTERFACE_ALIASING :
lambda x: self.GetAliases(x).items(),
-# telepathy.CONNECTION_INTERFACE_AVATARS :
-# lambda x: self.GetKnownAvatarTokens(x).items(),
+ telepathy.CONNECTION_INTERFACE_AVATARS :
+ lambda x: self.GetKnownAvatarTokens(x).items(),
telepathy.CONNECTION_INTERFACE_CAPABILITIES :
lambda x: self.GetCapabilities(x).items()
}
diff --git a/gadu/debug.py b/sunshine/debug.py
index 8f51129..57cc9f9 100644
--- a/gadu/debug.py
+++ b/sunshine/debug.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
#
@@ -18,8 +18,8 @@
import telepathy
-class GaduDebug(telepathy.server.Debug):
- """Gadu debug interface
+class SunshineDebug(telepathy.server.Debug):
+ """Sunshine debug interface
Implements the org.freedesktop.Telepathy.Debug interface"""
@@ -28,10 +28,10 @@ class GaduDebug(telepathy.server.Debug):
def get_record_name(self, record):
name = record.name
- if name.startswith("Gadu."):
+ if name.startswith("Sunshine."):
domain, category = name.split('.', 1)
else:
- domain = "gadu"
+ domain = "sunshine"
category = name
name = domain.lower() + "/" + category.lower()
return name
diff --git a/gadu/handle.py b/sunshine/handle.py
index b5ac916..accbfe4 100644
--- a/gadu/handle.py
+++ b/sunshine/handle.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -22,22 +22,22 @@ import weakref
import telepathy
-__all__ = ['GaduHandleFactory']
+__all__ = ['SunshineHandleFactory']
-logger = logging.getLogger('Gadu.Handle')
+logger = logging.getLogger('Sunshine.Handle')
-def GaduHandleFactory(connection, type, *args):
- mapping = {'self': GaduSelfHandle,
- 'contact': GaduContactHandle,
- 'list': GaduListHandle,
- 'group': GaduGroupHandle}
+def SunshineHandleFactory(connection, type, *args):
+ mapping = {'self': SunshineSelfHandle,
+ 'contact': SunshineContactHandle,
+ 'list': SunshineListHandle,
+ 'group': SunshineGroupHandle}
handle = mapping[type](connection, *args)
connection._handles[handle.get_type(), handle.get_id()] = handle
return handle
-class GaduHandleMeta(type):
+class SunshineHandleMeta(type):
def __call__(cls, connection, *args):
obj, newly_created = cls.__new__(cls, connection, *args)
if newly_created:
@@ -46,8 +46,8 @@ class GaduHandleMeta(type):
return obj
-class GaduHandle(telepathy.server.Handle):
- __metaclass__ = GaduHandleMeta
+class SunshineHandle(telepathy.server.Handle):
+ __metaclass__ = SunshineHandleMeta
instances = weakref.WeakValueDictionary()
def __new__(cls, connection, *args):
@@ -68,7 +68,7 @@ class GaduHandle(telepathy.server.Handle):
telepathy.HANDLE_TYPE_LIST : 'List',
telepathy.HANDLE_TYPE_GROUP : 'Group'}
type_str = type_mapping.get(self.type, '')
- return "<Gadu%sHandle id=%u name='%s'>" % \
+ return "<Sunshine%sHandle id=%u name='%s'>" % \
(type_str, self.id, self.name)
id = property(telepathy.server.Handle.get_id)
@@ -76,14 +76,14 @@ class GaduHandle(telepathy.server.Handle):
name = property(telepathy.server.Handle.get_name)
-class GaduSelfHandle(GaduHandle):
+class SunshineSelfHandle(SunshineHandle):
instance = None
def __init__(self, connection, id):
handle_type = telepathy.HANDLE_TYPE_CONTACT
handle_name = connection._account[0]
self._connection = connection
- GaduHandle.__init__(self, connection, id, handle_type, handle_name)
+ SunshineHandle.__init__(self, connection, id, handle_type, handle_name)
@property
def profile(self):
@@ -91,7 +91,7 @@ class GaduSelfHandle(GaduHandle):
return False
-class GaduContactHandle(GaduHandle):
+class SunshineContactHandle(SunshineHandle):
#TODO: GG using just UIN to indenrify user so we need just contact_uin instead of contact_account and contact_network)
def __init__(self, connection, id, contact_account, contact_network):
handle_type = telepathy.HANDLE_TYPE_CONTACT
@@ -101,7 +101,7 @@ class GaduContactHandle(GaduHandle):
self.pending_groups = set()
self.pending_alias = None
self._connection = connection
- GaduHandle.__init__(self, connection, id, handle_type, handle_name)
+ SunshineHandle.__init__(self, connection, id, handle_type, handle_name)
@property
def contact(self):
@@ -109,20 +109,20 @@ class GaduContactHandle(GaduHandle):
return result
-class GaduListHandle(GaduHandle):
+class SunshineListHandle(SunshineHandle):
def __init__(self, connection, id, list_name):
handle_type = telepathy.HANDLE_TYPE_LIST
handle_name = list_name
- GaduHandle.__init__(self, connection, id, handle_type, handle_name)
+ SunshineHandle.__init__(self, connection, id, handle_type, handle_name)
-class GaduGroupHandle(GaduHandle):
+class SunshineGroupHandle(SunshineHandle):
def __init__(self, connection, id, group_name):
handle_type = telepathy.HANDLE_TYPE_GROUP
handle_name = group_name
self._connection = connection
self.handle_name = group_name
- GaduHandle.__init__(self, connection, id, handle_type, handle_name)
+ SunshineHandle.__init__(self, connection, id, handle_type, handle_name)
@property
def group(self):
diff --git a/gadu/lqsoft/Makefile.am b/sunshine/lqsoft/Makefile.am
index 92f271d..021cc4a 100644
--- a/gadu/lqsoft/Makefile.am
+++ b/sunshine/lqsoft/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS = cstruct pygadu utils
-lqsoftdir = $(pythondir)/gadu/lqsoft
+lqsoftdir = $(pythondir)/sunshine/lqsoft
lqsoft_PYTHON = __init__.py
diff --git a/gadu/lqsoft/__init__.py b/sunshine/lqsoft/__init__.py
index e69de29..e69de29 100755
--- a/gadu/lqsoft/__init__.py
+++ b/sunshine/lqsoft/__init__.py
diff --git a/gadu/lqsoft/cstruct/Makefile.am b/sunshine/lqsoft/cstruct/Makefile.am
index ef2f46c..056ff96 100644
--- a/gadu/lqsoft/cstruct/Makefile.am
+++ b/sunshine/lqsoft/cstruct/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = fields test
-cstructdir = $(pythondir)/gadu/lqsoft/cstruct
+cstructdir = $(pythondir)/sunshine/lqsoft/cstruct
cstruct_PYTHON = common.py \
constraints.py \
__init__.py
diff --git a/gadu/lqsoft/cstruct/__init__.py b/sunshine/lqsoft/cstruct/__init__.py
index e69de29..e69de29 100755
--- a/gadu/lqsoft/cstruct/__init__.py
+++ b/sunshine/lqsoft/cstruct/__init__.py
diff --git a/gadu/lqsoft/cstruct/common.py b/sunshine/lqsoft/cstruct/common.py
index 9385105..b4824e9 100755
--- a/gadu/lqsoft/cstruct/common.py
+++ b/sunshine/lqsoft/cstruct/common.py
@@ -4,7 +4,7 @@
__author__="lreqc"
__date__ ="$2009-07-19 07:48:34$"
-import gadu.lqsoft.cstruct.constraints as const
+import sunshine.lqsoft.cstruct.constraints as const
import struct,sys
def log(msg):
diff --git a/gadu/lqsoft/cstruct/constraints.py b/sunshine/lqsoft/cstruct/constraints.py
index 0cd056a..0cd056a 100644
--- a/gadu/lqsoft/cstruct/constraints.py
+++ b/sunshine/lqsoft/cstruct/constraints.py
diff --git a/gadu/lqsoft/cstruct/fields/Makefile.am b/sunshine/lqsoft/cstruct/fields/Makefile.am
index 1882fdb..a622fd6 100644
--- a/gadu/lqsoft/cstruct/fields/Makefile.am
+++ b/sunshine/lqsoft/cstruct/fields/Makefile.am
@@ -1,4 +1,4 @@
-fieldsdir = $(pythondir)/gadu/lqsoft/cstruct/fields
+fieldsdir = $(pythondir)/sunshine/lqsoft/cstruct/fields
fields_PYTHON = complex.py \
__init__.py \
numeric.py \
diff --git a/gadu/lqsoft/cstruct/fields/__init__.py b/sunshine/lqsoft/cstruct/fields/__init__.py
index 357a126..357a126 100755
--- a/gadu/lqsoft/cstruct/fields/__init__.py
+++ b/sunshine/lqsoft/cstruct/fields/__init__.py
diff --git a/gadu/lqsoft/cstruct/fields/complex.py b/sunshine/lqsoft/cstruct/fields/complex.py
index ea09c29..e610758 100644
--- a/gadu/lqsoft/cstruct/fields/complex.py
+++ b/sunshine/lqsoft/cstruct/fields/complex.py
@@ -4,8 +4,8 @@
__author__ = "Łukasz Rekucki"
__date__ = "$2009-07-19 07:46:52$"
-from gadu.lqsoft.cstruct.common import ListItemWrapper, CField
-from gadu.lqsoft.cstruct.constraints import *
+from sunshine.lqsoft.cstruct.common import ListItemWrapper, CField
+from sunshine.lqsoft.cstruct.constraints import *
def array_padder(opts):
diff --git a/gadu/lqsoft/cstruct/fields/numeric.py b/sunshine/lqsoft/cstruct/fields/numeric.py
index 6c53770..2c55318 100755
--- a/gadu/lqsoft/cstruct/fields/numeric.py
+++ b/sunshine/lqsoft/cstruct/fields/numeric.py
@@ -6,8 +6,8 @@ __date__ = "$2009-07-19 07:46:52$"
import numbers
-from gadu.lqsoft.cstruct.common import *
-import gadu.lqsoft.cstruct.constraints as const
+from sunshine.lqsoft.cstruct.common import *
+import sunshine.lqsoft.cstruct.constraints as const
class NumericField(CField):
diff --git a/gadu/lqsoft/cstruct/fields/text.py b/sunshine/lqsoft/cstruct/fields/text.py
index 56ae9b1..dbf2cfc 100755
--- a/gadu/lqsoft/cstruct/fields/text.py
+++ b/sunshine/lqsoft/cstruct/fields/text.py
@@ -4,11 +4,11 @@
__author__ = "Łukasz Rekucki"
__date__ = "$2009-07-19 09:50:34$"
-from gadu.lqsoft.cstruct.common import CField, CStruct
-from gadu.lqsoft.cstruct.fields.numeric import UIntField
-from gadu.lqsoft.cstruct.fields.complex import StructField
+from sunshine.lqsoft.cstruct.common import CField, CStruct
+from sunshine.lqsoft.cstruct.fields.numeric import UIntField
+from sunshine.lqsoft.cstruct.fields.complex import StructField
-from gadu.lqsoft.cstruct.constraints import *
+from sunshine.lqsoft.cstruct.constraints import *
def string_padder(opts):
pad = opts['padding']
diff --git a/gadu/lqsoft/cstruct/test/Makefile.am b/sunshine/lqsoft/cstruct/test/Makefile.am
index 04a241a..df3f6d4 100644
--- a/gadu/lqsoft/cstruct/test/Makefile.am
+++ b/sunshine/lqsoft/cstruct/test/Makefile.am
@@ -1,4 +1,4 @@
-testdir = $(pythondir)/gadu/lqsoft/cstruct/test
+testdir = $(pythondir)/sunshine/lqsoft/cstruct/test
test_PYTHON = __init__.py \
test_complex.py \
test_numeric.py \
diff --git a/gadu/lqsoft/cstruct/test/__init__.py b/sunshine/lqsoft/cstruct/test/__init__.py
index c546d36..c546d36 100755
--- a/gadu/lqsoft/cstruct/test/__init__.py
+++ b/sunshine/lqsoft/cstruct/test/__init__.py
diff --git a/gadu/lqsoft/cstruct/test/test_complex.py b/sunshine/lqsoft/cstruct/test/test_complex.py
index bbb8776..bbb8776 100755
--- a/gadu/lqsoft/cstruct/test/test_complex.py
+++ b/sunshine/lqsoft/cstruct/test/test_complex.py
diff --git a/gadu/lqsoft/cstruct/test/test_numeric.py b/sunshine/lqsoft/cstruct/test/test_numeric.py
index 2b821e4..2b821e4 100755
--- a/gadu/lqsoft/cstruct/test/test_numeric.py
+++ b/sunshine/lqsoft/cstruct/test/test_numeric.py
diff --git a/gadu/lqsoft/cstruct/test/test_strings.py b/sunshine/lqsoft/cstruct/test/test_strings.py
index 9b3aaa7..9b3aaa7 100755
--- a/gadu/lqsoft/cstruct/test/test_strings.py
+++ b/sunshine/lqsoft/cstruct/test/test_strings.py
diff --git a/gadu/lqsoft/pygadu/Makefile.am b/sunshine/lqsoft/pygadu/Makefile.am
index f66a48b..16ddb3f 100644
--- a/gadu/lqsoft/pygadu/Makefile.am
+++ b/sunshine/lqsoft/pygadu/Makefile.am
@@ -1,4 +1,4 @@
-pygadudir = $(pythondir)/gadu/lqsoft/pygadu
+pygadudir = $(pythondir)/sunshine/lqsoft/pygadu
pygadu_PYTHON = __init__.py \
models.py \
network_base.py \
diff --git a/gadu/lqsoft/ggclient/__init__.py b/sunshine/lqsoft/pygadu/__init__.py
index e69de29..e69de29 100755
--- a/gadu/lqsoft/ggclient/__init__.py
+++ b/sunshine/lqsoft/pygadu/__init__.py
diff --git a/gadu/lqsoft/pygadu/models.py b/sunshine/lqsoft/pygadu/models.py
index 4001acb..1095b31 100755
--- a/gadu/lqsoft/pygadu/models.py
+++ b/sunshine/lqsoft/pygadu/models.py
@@ -2,7 +2,7 @@
__author__="lreqc"
__date__ ="$2009-07-14 07:33:27$"
-from gadu.lqsoft.pygadu.network_base import StructNotice
+from sunshine.lqsoft.pygadu.network_base import StructNotice
import xml.etree.ElementTree as ET
import hashlib
import zlib
diff --git a/sunshine/lqsoft/pygadu/network.py b/sunshine/lqsoft/pygadu/network.py
new file mode 100755
index 0000000..653b88c
--- /dev/null
+++ b/sunshine/lqsoft/pygadu/network.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8
+#
+
+__author__= "Łukasz Rekucki"
+__date__ = "$2009-07-23 19:35:08$"
+
+
+from sunshine.lqsoft.pygadu.network_base import *
+from sunshine.lqsoft.pygadu.network_v8 import *
diff --git a/gadu/lqsoft/pygadu/network_base.py b/sunshine/lqsoft/pygadu/network_base.py
index a951109..e3471fc 100755
--- a/gadu/lqsoft/pygadu/network_base.py
+++ b/sunshine/lqsoft/pygadu/network_base.py
@@ -2,12 +2,12 @@
__author__="lreqc"
__date__ ="$2009-07-14 01:07:32$"
-from gadu.lqsoft.pygadu.packets import inpacket, outpacket
+from sunshine.lqsoft.pygadu.packets import inpacket, outpacket
-from gadu.lqsoft.cstruct.common import CStruct
-from gadu.lqsoft.cstruct.fields import complex, numeric
+from sunshine.lqsoft.cstruct.common import CStruct
+from sunshine.lqsoft.cstruct.fields import complex, numeric
-from gadu.lqsoft.utils import Enum
+from sunshine.lqsoft.utils import Enum
PACKET_HEADER_LENGTH = 8
diff --git a/gadu/lqsoft/pygadu/network_v8.py b/sunshine/lqsoft/pygadu/network_v8.py
index 1be9bed..7921159 100755
--- a/gadu/lqsoft/pygadu/network_v8.py
+++ b/sunshine/lqsoft/pygadu/network_v8.py
@@ -9,19 +9,17 @@ import hashlib
import struct
# Cstruct stuff
-from gadu.lqsoft.cstruct.common import CStruct
-from gadu.lqsoft.cstruct.fields.numeric import *
-from gadu.lqsoft.cstruct.fields.text import *
-from gadu.lqsoft.cstruct.fields.complex import *
-
-
+from sunshine.lqsoft.cstruct.common import CStruct
+from sunshine.lqsoft.cstruct.fields.numeric import *
+from sunshine.lqsoft.cstruct.fields.text import *
+from sunshine.lqsoft.cstruct.fields.complex import *
# useful helpers
-from gadu.lqsoft.utils import Enum
+from sunshine.lqsoft.utils import Enum
# base protocol
-from gadu.lqsoft.pygadu.packets import inpacket, outpacket
-from gadu.lqsoft.pygadu.network_base import GaduPacket
+from sunshine.lqsoft.pygadu.packets import inpacket, outpacket
+from sunshine.lqsoft.pygadu.network_base import GaduPacket
#
# COMMON STRUCTURES
diff --git a/gadu/lqsoft/pygadu/packets.py b/sunshine/lqsoft/pygadu/packets.py
index eb261bc..eb261bc 100755
--- a/gadu/lqsoft/pygadu/packets.py
+++ b/sunshine/lqsoft/pygadu/packets.py
diff --git a/gadu/lqsoft/pygadu/twisted_protocol.py b/sunshine/lqsoft/pygadu/twisted_protocol.py
index 1c774cb..3c5839c 100755
--- a/gadu/lqsoft/pygadu/twisted_protocol.py
+++ b/sunshine/lqsoft/pygadu/twisted_protocol.py
@@ -7,8 +7,8 @@ from twisted.internet.protocol import Protocol
from twisted.internet import task
import twisted.python.log as tlog
-from gadu.lqsoft.pygadu.network import *
-from gadu.lqsoft.pygadu.packets import Resolver
+from sunshine.lqsoft.pygadu.network import *
+from sunshine.lqsoft.pygadu.packets import Resolver
import struct, time
diff --git a/sunshine/lqsoft/utils/Makefile.am b/sunshine/lqsoft/utils/Makefile.am
new file mode 100644
index 0000000..2224cc4
--- /dev/null
+++ b/sunshine/lqsoft/utils/Makefile.am
@@ -0,0 +1,2 @@
+utilsdir = $(pythondir)/sunshine/lqsoft/utils
+utils_PYTHON = __init__.py
diff --git a/gadu/lqsoft/utils/__init__.py b/sunshine/lqsoft/utils/__init__.py
index 47817ea..47817ea 100755
--- a/gadu/lqsoft/utils/__init__.py
+++ b/sunshine/lqsoft/utils/__init__.py
diff --git a/gadu/presence.py b/sunshine/presence.py
index 89f8c13..9630952 100644
--- a/gadu/presence.py
+++ b/sunshine/presence.py
@@ -1,4 +1,4 @@
-# telepathy-gadu is the GaduGadu connection manager for Telepathy
+# telepathy-sunshine is the GaduGadu connection manager for Telepathy
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2010 Krzysztof Klinikowski <kkszysiu@gmail.com>
@@ -28,15 +28,15 @@ import telepathy
import telepathy.constants
import telepathy.errors
-from gadu.handle import GaduHandleFactory
-from gadu.util.decorator import async
+from sunshine.handle import SunshineHandleFactory
+from sunshine.util.decorator import async
-__all__ = ['GaduPresence']
+__all__ = ['SunshinePresence']
-logger = logging.getLogger('Gadu.Presence')
+logger = logging.getLogger('Sunshine.Presence')
-class GaduPresenceMapping(object):
+class SunshinePresenceMapping(object):
ONLINE = 'available'
FFC = 'free_for_chat'
BUSY = 'busy'
@@ -111,7 +111,7 @@ class GaduPresenceMapping(object):
OFFLINE: telepathy.constants.CONNECTION_PRESENCE_TYPE_OFFLINE
}
-class GaduPresence(telepathy.server.ConnectionInterfacePresence,
+class SunshinePresence(telepathy.server.ConnectionInterfacePresence,
telepathy.server.ConnectionInterfaceSimplePresence):
def __init__(self):
@@ -130,19 +130,19 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
# you get one of these for each status
# {name:(type, self, exclusive, {argument:types}}
return {
- GaduPresenceMapping.ONLINE:(
+ SunshinePresenceMapping.ONLINE:(
telepathy.CONNECTION_PRESENCE_TYPE_AVAILABLE,
True, True, arguments),
- GaduPresenceMapping.BUSY:(
+ SunshinePresenceMapping.BUSY:(
telepathy.CONNECTION_PRESENCE_TYPE_BUSY,
True, True, arguments),
- GaduPresenceMapping.IDLE:(
+ SunshinePresenceMapping.IDLE:(
telepathy.CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY,
True, True, arguments),
- GaduPresenceMapping.INVISIBLE:(
+ SunshinePresenceMapping.INVISIBLE:(
telepathy.CONNECTION_PRESENCE_TYPE_HIDDEN,
True, True, {}),
- GaduPresenceMapping.OFFLINE:(
+ SunshinePresenceMapping.OFFLINE:(
telepathy.CONNECTION_PRESENCE_TYPE_OFFLINE,
True, True, {})
}
@@ -156,10 +156,10 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
def SetStatus(self, statuses):
status, arguments = statuses.items()[0]
- if status == GaduPresenceMapping.OFFLINE:
+ if status == SunshinePresenceMapping.OFFLINE:
self.Disconnect()
- presence = GaduPresenceMapping.to_gg[status]
+ presence = SunshinePresenceMapping.to_gg[status]
message = arguments.get('message', u'')
logger.info("Setting Presence to '%s'" % presence)
@@ -168,10 +168,10 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
message = message.encode('UTF-8')
if self._status == telepathy.CONNECTION_STATUS_CONNECTED:
- self._self_presence_changed(GaduHandleFactory(self, 'self'), presence, message)
+ self._self_presence_changed(SunshineHandleFactory(self, 'self'), presence, message)
self.profile.setMyState(presence, message)
else:
- self._self_presence_changed(GaduHandleFactory(self, 'self'), presence, message)
+ self._self_presence_changed(SunshineHandleFactory(self, 'self'), presence, message)
def get_presences(self, contacts):
presences = {}
@@ -186,21 +186,21 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
# presence = ButterflyPresenceMapping.to_telepathy[contact.presence]
# personal_message = unicode(contact.personal_message, "utf-8")
# else:
-# presence = GaduPresenceMapping.OFFLINE
+# presence = SunshinePresenceMapping.OFFLINE
# personal_message = u""
try:
contact = handle.profile
- presence = GaduPresenceMapping.OFFLINE
+ presence = SunshinePresenceMapping.OFFLINE
personal_message = u""
except AttributeError:
#I dont know what to do here. Do I really need this? :P
contact = handle.contact
if contact is not None:
- presence = GaduPresenceMapping.to_telepathy[contact.status]
+ presence = SunshinePresenceMapping.to_telepathy[contact.status]
#thats bad, mkay?
personal_message = unicode(contact.get_desc(), "utf-8")
else:
- presence = GaduPresenceMapping.OFFLINE
+ presence = SunshinePresenceMapping.OFFLINE
personal_message = u""
arguments = {}
@@ -217,11 +217,11 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
return self.get_simple_presences(contacts)
def SetPresence(self, status, message):
- if status == GaduPresenceMapping.OFFLINE:
+ if status == SunshinePresenceMapping.OFFLINE:
self.Disconnect()
try:
- presence = GaduPresenceMapping.to_gg[status]
+ presence = SunshinePresenceMapping.to_gg[status]
except KeyError:
raise telepathy.errors.InvalidArgument
@@ -231,32 +231,32 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
message = message.encode('UTF-8')
if self._status == telepathy.CONNECTION_STATUS_CONNECTED:
- self._self_presence_changed(GaduHandleFactory(self, 'self'), presence, message)
+ self._self_presence_changed(SunshineHandleFactory(self, 'self'), presence, message)
self.profile.setMyState(presence, message)
else:
- self._self_presence_changed(GaduHandleFactory(self, 'self'), presence, message)
+ self._self_presence_changed(SunshineHandleFactory(self, 'self'), presence, message)
def get_simple_presences(self, contacts):
presences = {}
for handle_id in contacts:
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle == GaduHandleFactory(self, 'self'):
+ if handle == SunshineHandleFactory(self, 'self'):
contact = handle.profile
- presence = GaduPresenceMapping.OFFLINE
+ presence = SunshinePresenceMapping.OFFLINE
personal_message = u""
else:
#I dont know what to do here. Do I really need this? :P
contact = handle.contact
if contact is not None:
- presence = GaduPresenceMapping.from_gg_to_tp[contact.status]
+ presence = SunshinePresenceMapping.from_gg_to_tp[contact.status]
#that bad, I dont know but when I set desc there I didnt get any contacts :/
#personal_message = str(contact.get_desc())
personal_message = str('')
else:
- presence = GaduPresenceMapping.OFFLINE
+ presence = SunshinePresenceMapping.OFFLINE
personal_message = u""
- presence_type = GaduPresenceMapping.to_presence_type[presence]
+ presence_type = SunshinePresenceMapping.to_presence_type[presence]
presences[handle] = (presence_type, presence, personal_message)
return presences
@@ -265,19 +265,19 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
# you get one of these for each status
# {name:(Type, May_Set_On_Self, Can_Have_Message}
return dbus.Dictionary({
- GaduPresenceMapping.ONLINE:(
+ SunshinePresenceMapping.ONLINE:(
telepathy.CONNECTION_PRESENCE_TYPE_AVAILABLE,
True, True),
- GaduPresenceMapping.BUSY:(
+ SunshinePresenceMapping.BUSY:(
telepathy.CONNECTION_PRESENCE_TYPE_BUSY,
True, True),
- GaduPresenceMapping.IDLE:(
+ SunshinePresenceMapping.IDLE:(
telepathy.CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY,
True, True),
- GaduPresenceMapping.INVISIBLE:(
+ SunshinePresenceMapping.INVISIBLE:(
telepathy.CONNECTION_PRESENCE_TYPE_HIDDEN,
True, True),
- GaduPresenceMapping.OFFLINE:(
+ SunshinePresenceMapping.OFFLINE:(
telepathy.CONNECTION_PRESENCE_TYPE_OFFLINE,
True, True)
}, signature='s(ubb)')
@@ -305,10 +305,10 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
@async
def _presence_changed(self, handle, presence, personal_message):
try:
- presence = GaduPresenceMapping.from_gg_to_tp[presence]
+ presence = SunshinePresenceMapping.from_gg_to_tp[presence]
except KeyError:
- presence = GaduPresenceMapping.from_gg_to_tp[0]
- presence_type = GaduPresenceMapping.to_presence_type[presence]
+ presence = SunshinePresenceMapping.from_gg_to_tp[0]
+ presence_type = SunshinePresenceMapping.to_presence_type[presence]
personal_message = unicode(str(personal_message), "utf-8")
self.PresencesChanged({handle: (presence_type, presence, personal_message)})
@@ -322,8 +322,8 @@ class GaduPresence(telepathy.server.ConnectionInterfacePresence,
@async
def _self_presence_changed(self, handle, presence, personal_message):
- presence = GaduPresenceMapping.to_telepathy[presence]
- presence_type = GaduPresenceMapping.to_presence_type[presence]
+ presence = SunshinePresenceMapping.to_telepathy[presence]
+ presence_type = SunshinePresenceMapping.to_presence_type[presence]
personal_message = unicode(str(personal_message), "utf-8")
self.PresencesChanged({handle: (presence_type, presence, personal_message)})
diff --git a/gadu/util/Makefile.am b/sunshine/util/Makefile.am
index bd72d1c..f4cd81a 100644
--- a/gadu/util/Makefile.am
+++ b/sunshine/util/Makefile.am
@@ -1,3 +1,3 @@
-utildir = $(pythondir)/gadu/util
+utildir = $(pythondir)/sunshine/util
util_PYTHON = decorator.py \
__init__.py
diff --git a/gadu/lqsoft/pygadu/__init__.py b/sunshine/util/__init__.py
index e69de29..e69de29 100755..100644
--- a/gadu/lqsoft/pygadu/__init__.py
+++ b/sunshine/util/__init__.py
diff --git a/gadu/util/decorator.py b/sunshine/util/decorator.py
index 250e2d2..250e2d2 100644
--- a/gadu/util/decorator.py
+++ b/sunshine/util/decorator.py
diff --git a/telepathy-gadu b/telepathy-sunshine
index f466b4d..50b5ae6 100755
--- a/telepathy-gadu
+++ b/telepathy-sunshine
@@ -22,17 +22,17 @@ if telepathy.version < (0, 15, 11):
from telepathy.utils import debug_divert_messages
-debug_divert_messages(os.getenv('GADU_LOGFILE'))
+debug_divert_messages(os.getenv('SUNSHINE_LOGFILE'))
logging.basicConfig(level=logging.DEBUG)
-from gadu import GaduConnectionManager
-from gadu import GaduDebug
-from gadu.util.decorator import async
+from sunshine import SunshineConnectionManager
+from sunshine import SunshineDebug
+from sunshine.util.decorator import async
-logger = logging.getLogger('Gadu')
+logger = logging.getLogger('Sunshine')
IDLE_TIMEOUT = 5000
-PROCESS_NAME = 'telepathy-gadu'
+PROCESS_NAME = 'telepathy-sunshine'
if __name__ == '__main__':
try: # change process name for killall
@@ -47,7 +47,7 @@ if __name__ == '__main__':
manager.quit()
reactor.stop()
- if 'GADU_PERSIST' not in os.environ:
+ if 'SUNSHINE_PERSIST' not in os.environ:
def timeout_cb():
if len(manager._connections) == 0:
logger.info('No connection received - quitting')
@@ -61,8 +61,8 @@ if __name__ == '__main__':
signal.signal(signal.SIGTERM, lambda : quit)
try:
- manager = GaduConnectionManager(shutdown_func=shutdown_callback)
- handler = GaduDebug(manager)
+ manager = SunshineConnectionManager(shutdown_func=shutdown_callback)
+ handler = SunshineDebug(manager)
except dbus.exceptions.NameExistsException:
logger.warning('Failed to acquire bus name, connection manager already running?')
sys.exit(1)