#!/usr/bin/python
#
# Copyright (C) 2010 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# 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/>.
#
# Copyright (C) 2010 Ken VanDine <email address hidden>
#
# Launch script for Gwibber Accounts
#
import sys
from os.path import join, dirname, exists, realpath, abspath
import gtk, gobject, wnck
from dbus.mainloop.glib import DBusGMainLoop
######################################################################
# Don't run again if we are already running
progname = "gwibber-accounts"
screen = wnck.screen_get_default()
while gtk.events_pending():
gtk.main_iteration()
for w in screen.get_windows():
if w.get_application().get_name() == progname:
import time
w.move_to_workspace(screen.get_active_workspace())
w.activate(int(time.time()))
print int(time.time())
quit()
# If we were invoked from a Gwibber source directory add that as the
# preferred module path ...
if exists(join(SOURCE_DIR, "accounts.py")):
sys.path.insert(0, realpath(dirname(SOURCE_DIR)))
try:
from gwibber.microblog.util import log log.logger.name = "Gwibber Accounts" log.logger.info("Running from the source tree")
from gwibber import accounts
finally:
del sys.path[0]
else:
from gwibber.microblog.util import log
log.logger.name = "Gwibber Accounts"
log.logger.info("Running from the system path")
from gwibber import accounts
Source Code Gwibber-Accounts
#!/usr/bin/python www.gnu. org/licenses/>.
#
# Copyright (C) 2010 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# 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://
#
# Copyright (C) 2010 Ken VanDine <email address hidden>
#
# Launch script for Gwibber Accounts
#
import sys
from os.path import join, dirname, exists, realpath, abspath
import gtk, gobject, wnck
from dbus.mainloop.glib import DBusGMainLoop
####### ####### ####### ####### ####### ####### ####### ####### ####### ####### get_default( ) pending( ): iteration( ) get_windows( ): on().get_ name() == progname: to_workspace( screen. get_active_ workspace( )) int(time. time()) )
# Don't run again if we are already running
progname = "gwibber-accounts"
screen = wnck.screen_
while gtk.events_
gtk.main_
for w in screen.
if w.get_applicati
import time
w.move_
w.activate(
print int(time.time())
quit()
####### ####### ####### ####### ####### ####### ####### ####### ####### ####### sys.path[ 0])
# Setup path
LAUNCH_DIR = abspath(
SOURCE_DIR = join(LAUNCH_DIR, "..", "gwibber")
# If we were invoked from a Gwibber source directory add that as the join(SOURCE_ DIR, "accounts.py")): path.insert( 0, realpath( dirname( SOURCE_ DIR))) microblog. util import log
log.logger. name = "Gwibber Accounts"
log.logger. info("Running from the source tree") microblog. util import log logger. info("Running from the system path")
# preferred module path ...
if exists(
sys.
try:
from gwibber.
from gwibber import accounts
finally:
del sys.path[0]
else:
from gwibber.
log.logger.name = "Gwibber Accounts"
log.
from gwibber import accounts
####### ####### ####### ####### ####### ####### ####### ####### ####### ####### add_option( "-d", "--debug", action= "store_ true",
dest= "debug" , default=False,
help= "Log debug messages")
# Options
from optparse import OptionParser
parser = OptionParser()
parser.
(options, args) = parser.parse_args()
if options.debug: setLevel( log.logging. DEBUG) setLevel( log.logging. INFO) ####### ####### ####### ####### ####### ####### ####### ####### #######
log.logger.
else:
log.logger.
#######
DBusGMainLoop( set_as_ default= True) GwibberAccountM anager( )
accounts.
gtk.main()