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
 
get_screenlet_linux_name_by_class_path(path)
Returns screenlet name on form 'foobar-screenlet' by main screenlet class file path.
source code
 
get_screenlet_linux_name_by_class_name(name)
Returns screenlet name on form 'foobar-screenlet' by screenlet class name.
source code
 
get_screenlet_linux_name_by_short_class_name(name)
Returns screenlet name on form 'foobar-screenlet' by shortened screenlet class name.
source code
 
is_screenlets_ppa_enabled()
Detect if Screenlets default PPA is enabled on system.
source code
 
get_translator(path)
Returns translator by screenlet class path from __file__.
source code
 
_contains_path(string)
Internal function: Returns true if the given string contains one of the Screenlets paths.
source code
 
create_user_dir()
Create the userdir for the screenlets.
source code
 
find_first_screenlet_path(screenlet_name)
Scan the Screenlets paths for the occurence of screenlet "name" with the highest version 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_by_path(path)
Returns a dict with name, info, author and version of the given screenlet.
source code
 
get_screenlet_metadata(screenlet_name)
Returns a dict with name, info, author and version of the given screenlet.
source code
 
refresh_available_screenlet_paths()
Checks the system Screenlets directory for screenlet packs and updates screenlets.SCREENLETS_PATH.
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/mp/.screenlets'
  DIR_AUTOSTART = '/home/mp/.config/autostart/'
  __package__ = 'screenlets'
Function Details [hide private]

find_first_screenlet_path(screenlet_name)

source code 

Scan the Screenlets paths for the occurence of screenlet "name" with the highest version and return the full path to it. This function is used to get the theme/data directories for a Screenlet and run the Screenlet.

get_screenlet_metadata_by_path(path)

source code 

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

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.

refresh_available_screenlet_paths()

source code 

Checks the system Screenlets directory for screenlet packs and updates screenlets.SCREENLETS_PATH. Doesn't remove outdated paths (this doesn't hurt anyone).

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.