Package screenlets :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Classes [hide private]
  ScreenletInfo
A container with info about a screenlet.
  FileMonitor
A simple wrapper around Gnome VFS file monitors.
  IniReader
A simple config/ini-reader class.
  Notifier
A simple and conveniet wrapper for the notification-service.
Functions [hide private]
 
_(s) source code
 
get_autostart_dir()
Returns the system autostart directory
source code
 
is_manager_running_me()
checks if the one starting the screenlet is the screenlets manager
source code
 
containsAll(str, set)
Check whether 'str' contains ALL of the chars in 'set'
source code
 
containsAny(str, set)
Check whether 'str' contains ANY of the chars in 'set'
source code
 
create_autostarter(name)
Create a .desktop-file for the screenlet with the given name in $HOME/.config/autostart.
source code
 
delete_autostarter(name)
Delete the autostart for the given screenlet.
source code
 
_contains_path(string)
Internal function: Returns true if the given string contains one of the SCREENLETS_PATH entries.
source code
 
create_user_dir()
Create the userdir for the screenlets.
source code
 
find_first_screenlet_path(screenlet_name)
Scan the SCREENLETS_PATH for the first occurence of screenlet "name" and return the full path to it.
source code
 
get_screenlet_icon(screenlet_name, width, height) source code
 
getBetween(data, first, last) source code
 
get_screenlet_metadata(screenlet_name)
Returns a dict with name, info, author and version of the given screenlet.
source code
 
list_available_screenlets()
Scan the SCREENLETS_PATHs for all existing screenlets and return their names (without trailing "Screenlet") as a list of strings.
source code
 
list_running_screenlets()
Returns a list with names of running screenlets or None if no Screenlet is currently running.
source code
 
list_running_screenlets2()
Returns a list with names of running screenlets.
source code
 
get_screenlet_process(name)
Returns the PID of the given screenlet (if running) or None.
source code
 
get_user_dir(key, default)
http://www.freedesktop.org/wiki/Software/xdg-user-dirs
source code
 
get_daemon_iface()
Check if the daemon is already running and return its interface.
source code
 
get_desktop_dir()
Returns desktop dir
source code
 
get_filename_on_drop(sel_data)
Returns filenames of window droped files
source code
 
LoadPlaces()
Returns mount points in media
source code
 
LoadBookmarks()
Returns gtk bookmarks
source code
 
quit_screenlet_by_name(name)
Quit all instances of the given screenlet type.
source code
 
quit_all_screenlets() source code
 
restart_all_screenlets() source code
 
readMountFile(filename)
Reads fstab file
source code
 
read_file(filename)
Reads a file
source code
 
strip_html(string)
Strips HTML tags of a string
source code
 
lookup_daemon_autostart()
Adds Screenlets-daemon to autostart if not already
source code
 
launch_screenlet(screenlet)
Launches a screenlet
source code
 
xdg_open(name)
Opens anything
source code
Variables [hide private]
  USER = 1
  DIR_USER = '/home/helder/.screenlets'
  DIR_AUTOSTART = '/home/helder/.config/autostart/'
Function Details [hide private]

find_first_screenlet_path(screenlet_name)

source code 
Scan the SCREENLETS_PATH for the first occurence of screenlet "name" and return the full path to it. This function is used to get the theme/data directories for a Screenlet.

get_screenlet_metadata(screenlet_name)

source code 
Returns a dict with name, info, author and version of the given screenlet. Use with care because it always imports the screenlet module and shouldn't be used too often due to performance issues.

list_running_screenlets()

source code 
Returns a list with names of running screenlets or None if no Screenlet is currently running. Function returns False if an error happened!

list_running_screenlets2()

source code 
Returns a list with names of running screenlets. The list can be empty if no Screenlet is currently running.