# 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. import os import math import cairo import awn awn.check_dependencies(globals(), "rsvg") theme_dir = os.path.join(os.path.dirname(__file__), "themes") class SensorIcon(): def __init__(self, theme, sensors, height, hand_color): """ Initialize icon. Load icon background, create cairo context and render background. theme: icon theme sensors: list of sensors who's values are shown in this icon height: applet height in pixels """
along with this program. If not, see <http://www.gnu.org/licenses/gpl.txt>. ''' import os import re import sys from time import time import gtk import awn from awn.extras import _, awnlib, __version__ import gobject import cairo awn.check_dependencies(globals(), "gtop") import bwmprefs import interfaces_dialog APPLET_NAME = _('Bandwidth Monitor') APPLET_VERSION = '0.3.9.4' APPLET_COPYRIGHT = '© 2006-2009 CURE|THE|ITCH' APPLET_AUTHORS = ['Kyle L. Huff <*****@*****.**>'] APPLET_DESCRIPTION = _('Network Bandwidth monitor') APPLET_WEBSITE = 'http://www.curetheitch.com/projects/awn-bwm/' ICON_DIR = os.path.join(os.path.dirname(__file__), 'images') APPLET_ICON = os.path.join(ICON_DIR, 'icon.png') UI_FILE = os.path.join(os.path.dirname(__file__), 'bandwidth-monitor.ui')
# version 2 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # import sys import datetime import awn awn.check_dependencies(globals(), 'gdata') import gdata.calendar.service import gdata.service import gdata.calendar import webbrowser from awn.extras import _ CAPTCHA_URI = 'https://www.google.com/accounts/DisplayUnlockCaptcha' + \ '?service=calendar' class GoogleCal: events = [] requires_login = True
from xml.dom import minidom import time import pygtk pygtk.require('2.0') import gtk import pango import gobject import gettext from desktopagnostic.config import GROUP_DEFAULT import awn from awn.extras import _, awnlib, __version__, APPLET_BASEDIR from awn.extras.threadqueue import ThreadQueue, async_method awn.check_dependencies(globals(), 'feedparser', 'pynotify', json=('json', 'simplejson')) import classes socket.setdefaulttimeout(30) icondir = os.path.join(APPLET_BASEDIR, 'feeds', 'icons') icon_path = os.path.join(icondir, 'awn-feeds.svg') greader_path = os.path.join(icondir, 'awn-feeds-greader.svg') config_dir = os.environ['HOME'] + '/.config/awn/applets' config_path = os.path.join(config_dir, 'feeds.txt') cache_dir = os.environ['HOME'] + '/.cache/awn-feeds-applet'
try: import gtkmozembed except ImportError: print ' #####################################' print 'Gtkmozembed is needed to run Pandora, please install.' print ' * On Debian or Ubuntu based systems, install python-gnome2-extras' print ' * On Gentoo based systems, install dev-python/gnome-python-extras' print ' * On Fedora based systems, install gnome-python2-gtkmozembed' print ' * On SUSE based systems, install python-gnome-extras' print ' * On Mandriva based systems, install gnome-python-gtkmozembed' print 'See: http://wiki.awn-project.org/Awn_Extras:Dependency_Matrix' print ' #####################################' # Add pop up if gtkmozembed isn't found awn.check_dependencies(globals(), 'gtkmozembed') applet_name = "Pandora" applet_version = "0.3.3" applet_description = "Listen to Pandora from Awn" applet_theme_logo = "pandora" class GetPandoraUrl(htmllib.HTMLParser): def __init__(self, formatterinit) : htmllib.HTMLParser.__init__(self, formatterinit) self.values = [] def start_param(self, attrs) : if len(attrs) > 0 : for attr in attrs : if attr[0] == "value" :
# # 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, see <http://www.gnu.org/licenses/>. import pygtk pygtk.require('2.0') import gtk import awn from awn.extras import awnlib awn.check_dependencies(globals(), wnck=['xfce4.netk', 'wnck']) applet_name = "Show Desktop" applet_version = "0.3.3" applet_description = "An applet to hide your windows and show your desktop" # Applet's themed icon, also shown in the GTK About dialog applet_logo = "desktop" titles = {True: "Show hidden windows", False: "Hide windows and show desktop"} class ShowDesktopApplet: """An applet to hide your windows and show your desktop. """
# the Free Software Foundation, version 2 of the License. # # 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, see <http://www.gnu.org/licenses/>. import math import os import cairo import awn awn.check_dependencies(globals(), "rsvg") cairo_clock_themes_dir = "/usr/share/cairo-clock/themes" default_themes_dir = os.path.join(os.path.dirname(__file__), "themes") class AnalogClockThemeProvider: """Provides handles of SVG files that are part of the theme. The librsvg handles can be used to be rendered to a C{cairo.Context}. """ def __init__(self, theme_name): """Load the necessary SVG files of the specified theme. """
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # Import standard modules import gobject import gtk from desktopagnostic import config import awn import os import sys import tempfile from awn.extras import _, awnlib # Import Comics! modules, but check dependencies first awn.check_dependencies(globals(), 'feedparser', 'pynotify') from pynotify import init as notify_init, Notification import comics_manage import comics_view from comics_add import ComicsAdder from feed.settings import Settings from feed import FeedContainer from shared import ( ALT_USER_DIR, ICONS_DIR, STRIPS_DIR, SYS_FEEDS_DIR, UI_DIR, USER_DIR, USER_FEEDS_DIR) APPLET_NAME = 'comics' applet_display_name = _('Comics!') applet_icon = os.path.join(ICONS_DIR, 'comics-icon.svg')
# version 2 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # import datetime import awn awn.check_dependencies(globals(), 'dateutil', 'vobject') from dateutil.rrule import rrulestr from awn.extras import _ class IcsCal: events = [] get_start = False get_end = False in_event = False summary = None start = None end = None requires_login = False
# License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # Import standard modules import gobject import gtk from desktopagnostic import config import awn import os import sys import tempfile from awn.extras import _, awnlib # Import Comics! modules, but check dependencies first awn.check_dependencies(globals(), 'feedparser', 'pynotify') from pynotify import init as notify_init, Notification import comics_manage import comics_view from comics_add import ComicsAdder from feed.settings import Settings from feed import FeedContainer from shared import (ALT_USER_DIR, ICONS_DIR, STRIPS_DIR, SYS_FEEDS_DIR, UI_DIR, USER_DIR, USER_FEEDS_DIR) APPLET_NAME = 'comics' applet_display_name = _('Comics!') applet_icon = os.path.join(ICONS_DIR, 'comics-icon.svg')
# License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # import datetime import awn awn.check_dependencies(globals(), 'dateutil', 'vobject') from dateutil.rrule import rrulestr from awn.extras import _ class IcsCal: events = [] get_start = False get_end = False in_event = False summary = None start = None end = None requires_login = False
# 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA # AWN required modules import sys import os import gtk import awn # APPLET required modules import gobject awn.check_dependencies(globals(), 'xklavier') from xklavier import * from desktopagnostic.config import GROUP_DEFAULT as group from desktopagnostic.config import BIND_METHOD_FALLBACK as bind_fb from awn.extras import _ # DEFINE applet class class Dialect(awn.AppletSimple): # INITIALISE # PREFERENCES properties left = gobject.property(type=int, default=2) middle = gobject.property(type=int, default=1)
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see <http://www.gnu.org/licenses/>. try: import glib except ImportError: import gobject as glib from awn.extras import _ from awn import check_dependencies check_dependencies(globals(), "pynotify") # Minutes until the a closed warning is shown again warning_closed_timeout = 5.0 class MessageHandler: def __init__(self, applet): self.applet = applet pynotify.init(applet.applet.meta["short"]) self.message = pynotify.Notification( "Battery") # dummy value (will be replaced later) self.set_next(InvisibleMessageState)
try: import gtkmozembed except ImportError: print ' #####################################' print 'Gtkmozembed is needed to run Pandora, please install.' print ' * On Debian or Ubuntu based systems, install python-gnome2-extras' print ' * On Gentoo based systems, install dev-python/gnome-python-extras' print ' * On Fedora based systems, install gnome-python2-gtkmozembed' print ' * On SUSE based systems, install python-gnome-extras' print ' * On Mandriva based systems, install gnome-python-gtkmozembed' print 'See: http://wiki.awn-project.org/Awn_Extras:Dependency_Matrix' print ' #####################################' # Add pop up if gtkmozembed isn't found awn.check_dependencies(globals(), 'gtkmozembed') applet_name = "Pandora" applet_version = "0.3.3" applet_description = "Listen to Pandora from Awn" applet_theme_logo = "pandora" class GetPandoraUrl(htmllib.HTMLParser): def __init__(self, formatterinit): htmllib.HTMLParser.__init__(self, formatterinit) self.values = [] def start_param(self, attrs): if len(attrs) > 0: for attr in attrs:
# # 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, see <http://www.gnu.org/licenses/>. import pygtk pygtk.require('2.0') import gtk import awn from awn.extras import awnlib awn.check_dependencies(globals(), wnck=['xfce4.netk', 'wnck']) applet_name = "Show Desktop" applet_version = "0.3.3" applet_description = "An applet to hide your windows and show your desktop" # Applet's themed icon, also shown in the GTK About dialog applet_logo = "desktop" titles = {True: "Show hidden windows", False: "Hide windows and show desktop"} class ShowDesktopApplet: """An applet to hide your windows and show your desktop.
along with this program. If not, see <http://www.gnu.org/licenses/gpl.txt>. """ import os import gtk from gtk import gdk import awn from awn import Dialog, cairo_rounded_rect, ROUND_ALL, OverlayText from awn.extras import _ import cairo import dbus awn.check_dependencies(globals(), "gtop") ICON_DIR = os.path.join(os.path.dirname(__file__), "images") class NetworkManager: def __init__(self): self.bus = dbus.SystemBus() self.nm_path = "org.freedesktop.NetworkManager" self.nm_object = self.bus.get_object(self.nm_path, "/org/freedesktop/NetworkManager") def get_device_by_name(self, dev_name): try: for dev_opath in self.nm_object.GetDevices(dbus_interface=self.nm_path): device = self.bus.get_object(self.nm_path, dev_opath) if self.get_device_name(device) == dev_name:
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see <http://www.gnu.org/licenses/>. try: import glib except ImportError: import gobject as glib from awn.extras import _ from awn import check_dependencies check_dependencies(globals(), "pynotify") # Minutes until the a closed warning is shown again warning_closed_timeout = 5.0 class MessageHandler: def __init__(self, applet): self.applet = applet pynotify.init(applet.applet.meta["short"]) self.message = pynotify.Notification("Battery") # dummy value (will be replaced later) self.set_next(InvisibleMessageState) def set_next(self, state):