modules::clMain::main Class Reference

Pyjama's main class which is passed to most modules as pyjama. More...

List of all members.

Public Member Functions

def __init__
 The Constructor.
def go_home
 Navigate to pyjama's default page shown at startup.
def go_home_fkt
 Pyjama's default home-function showing 10 best rated albums of this week.
def set_home_fkt
 Set a new function to call when go_home() is called.
def read_playlist
 Read a jamendo m3u playlist file and populates the playlist with that.
def simple_database_downloader
 Downloads the database from jamendo and prints all messages to console.
def set_download_database_fkt
 Sets a download function for jamendo's database.
def show_plugins
 Show the plugin dialog.
def show_preferences
 Show the preferences dialog.
def check_another_instance_running
 This function can only tell if another instance is running but not, if NO other instance is running.
def quit
 Quit some running processes usually called by window.really_quit().
def reload_current_page
 Reloads the current layout page.
def info
 shows an info dialog
def error
 Called whenever pyjama.Events.raise_event("error", *args) is fired.
def ev_plugin_loaded
 Called whenever pyjama.Events.raise_event("pluginloaded", *args) is fired.
def set_allow_rearrange
 Setting self.allow_rearrange.
def appendtracks
 Add a given list of track objects to playlist.
def remove_item_from_playlist
 Removes an item from the playlist.
def move_playlist_item
 Moves an item in the playlist.
def add2playlist
 Adds a single track to the playlist.
def showInfo
 Set the Cover image and some other informations.
def setplaylist
 Mark the currently played item and unmark the last played item.
def stop_timer
 Empty function.
def start_timer
 Start the gobject timer.
def start_pulsing
 Start pulsing the progressbar.
def pulse
 Will pulse the progressbar a step.
def stop_pulsing
 Stops pulsing.
def timer_event
 This event is called ever 200ms by start_timer().
def setInfo
 Sets the "Info" column of the statusbar to text.
def setStatus
 Sets the "Player" column of the statusbar to text.
def notification
 Shows a notification.
def switch_window_state
 Iconifies the window to taskbar if its shown and shows the window when its hidden.
def get_album_image
 Downloads and caches an album's image from jamendo.

Public Attributes

 verbose
 Holds a bool indicating if pyjama is running verbose.
 debug
 Holds a bool indicating if pyjama is running in debugging mode.
 debug_extreme
 Holds a bool indicating if pyjama is running in debugging extreme mode.
 version
 Hold pyjama's current version.
 need_attention
 In some cases to many windows pop up on pyjama's startup.
 Events
 Pyjama's Event class.
 home_fkt
 settings
 Pyjama's Settings class Use for simple general settings data will be stored in a pyjama.cfg.
 settingsdb
 Pyjama's database setting class Use this, if you need to store many values.
 db
 Database class clDB.DB.
 dump_tools
 Some database-dump tools.
 window
 The clWindow.gtkWIN reference.
 icon
 The notification TrayIcon class notification.TrayIcon.
 player
 The Audio class clGstreamer010.Player.
 jamendo
 Pyjama's class for jamendo's get2 api clJamendo.Jamendo.
 browser
 The browser class clBrowserInterfacce.Browser for handling different browser calls.
 layouts
 Pyjama's clLayouts.Layouts is referenced here it is most important for anything to show up in the main paned field.
 preferences
 Preferences.
 xmlrpc
 nocolor
 A boold indicating if theming is used or not.
 allow_rearrange
 Switches every 200 ms to rearrange widgets if the window size changed.
 home
 Pyjama's home directory.
 tvMarkedItem
 Stores the currently marked item.
 playlist_to_load
 If one sets this attrib to a string which is an file's uri, pyjama will load that file as a playlist and set this attrib to None again.
 download_database
 Function to call when a database should be downloaded.
 pulsing
 Bool - is the progressbar pulsing?
 historyBack
 List storing history_back items.
 historyForward
 List storing history_forward items.
 historyCurrent
 Dictionary stroing the currently shown page.
 playlists
 bookmarks
 plugins
 clPlugin.Plugins class referenced here.


Detailed Description

Pyjama's main class which is passed to most modules as pyjama.

Definition at line 105 of file clMain.py.


Member Function Documentation

def modules::clMain::main::__init__ (   self,
  parent,
  options 
)

The Constructor.

Parameters:
self Object Pointer
parent The class calling pyjama. In this case this is clWindow. Since 'main' is thought to be the main class, parent is later treated as if it was a child of 'main'
options A OptionParser object

Definition at line 113 of file clMain.py.

def modules::clMain::main::add2playlist (   self,
  track 
)

Adds a single track to the playlist.

Parameters:
self Object Pointer
track a Track
Returns:
None

Definition at line 575 of file clMain.py.

def modules::clMain::main::appendtracks (   self,
  tracks,
  play = False 
)

Add a given list of track objects to playlist.

Parameters:
self Object Pointer
tracks List of Tracks
play Optional bool. If this is set True pyjama will start playing the first track of the given list
Returns:
None

Definition at line 524 of file clMain.py.

def modules::clMain::main::check_another_instance_running (   self  ) 

This function can only tell if another instance is running but not, if NO other instance is running.

Returns:
True if another instance is running, None if undecideable(?)

Definition at line 407 of file clMain.py.

def modules::clMain::main::error (   self,
  error_inst,
  desc = False 
)

Called whenever pyjama.Events.raise_event("error", *args) is fired.

Will print an error and its traceback to console

Parameters:
self Object Pointer
error_inst A short error message
desc Optional description of that error
Returns:
None

Definition at line 469 of file clMain.py.

def modules::clMain::main::ev_plugin_loaded (   self,
  name,
  version,
  order,
  mod_name 
)

Called whenever pyjama.Events.raise_event("pluginloaded", *args) is fired.

Prints some infos for the loaded plugin to console

Parameters:
self Object Pointer
name The plugin's full name
version The plugin's version
order Plugin's order value (see clPlugin documentation)
mod_name Plugin's file name
Returns:
None

Definition at line 489 of file clMain.py.

def modules::clMain::main::get_album_image (   self,
  album_id,
  size = 100 
)

Downloads and caches an album's image from jamendo.

Parameters:
self Object Pointer
album_id The album's id
size Optional size as int - default is 100
Returns:
  • None if an error occures
  • The file's URI as string if downloading was succesfull

Definition at line 836 of file clMain.py.

def modules::clMain::main::go_home (   self  ) 

Navigate to pyjama's default page shown at startup.

Parameters:
self The Object Pointer

Definition at line 302 of file clMain.py.

def modules::clMain::main::go_home_fkt (   self  ) 

Pyjama's default home-function showing 10 best rated albums of this week.

Parameters:
self The Object Pointer

Definition at line 309 of file clMain.py.

def modules::clMain::main::move_playlist_item (   self,
  s,
  d,
  before 
)

Moves an item in the playlist.

Parameters:
self Object Pointer
s Source path of item moved
d Destination path of the item moved
before Indicates of the item is dropped after or before the destination
Returns:
None

Definition at line 552 of file clMain.py.

def modules::clMain::main::notification (   self,
  caption,
  text,
  icon = "pyjama",
  size = 100 
)

Shows a notification.

Parameters:
self Object Pointer
caption The notification's caption as string
text The notification's text as stirng
icon The notification's icon as URI string
size The notification's icon size as int
Returns:
None

Definition at line 812 of file clMain.py.

def modules::clMain::main::pulse (   self  ) 

Will pulse the progressbar a step.

Parameters:
self Object Pointer
Returns:
  • True if the progressbar is in pulsing mode
  • False if the progressbar is in normal mode

Definition at line 698 of file clMain.py.

def modules::clMain::main::read_playlist (   self,
  playlist 
)

Read a jamendo m3u playlist file and populates the playlist with that.

Parameters:
playlist The playlist's uri
Returns:
List with track ids

Definition at line 323 of file clMain.py.

def modules::clMain::main::reload_current_page (   self,
  ev = None,
  ignore_cache = False 
)

Reloads the current layout page.

Parameters:
self Object Pointer
event Dummy param for callbacks
ignore_cache Bool indicating if reload should be cached or not. Set it to True if you want pyjama to reload this query from Jamendo
Returns:
None

Definition at line 435 of file clMain.py.

def modules::clMain::main::remove_item_from_playlist (   self,
  item 
)

Removes an item from the playlist.

Parameters:
self Object Pointer
item Integer
Returns:
None

Definition at line 539 of file clMain.py.

def modules::clMain::main::set_allow_rearrange (   self  ) 

Setting self.allow_rearrange.

This function is called by an gobject Timeout and allways return False

Parameters:
self Object Pointer
Returns:
False

Definition at line 497 of file clMain.py.

def modules::clMain::main::set_download_database_fkt (   self,
  fkt 
)

Sets a download function for jamendo's database.

Parameters:
self Object Pointer
fkt The function to run

Definition at line 386 of file clMain.py.

def modules::clMain::main::set_home_fkt (   self,
  fkt 
)

Set a new function to call when go_home() is called.

Parameters:
self The Object Pointer
fkt The function to call when go_home() is called

Definition at line 315 of file clMain.py.

def modules::clMain::main::setInfo (   self,
  text 
)

Sets the "Info" column of the statusbar to text.

Parameters:
self Object Pointer
text The text to set
Returns:
None

Definition at line 793 of file clMain.py.

def modules::clMain::main::setplaylist (   self,
  activate_item 
)

Mark the currently played item and unmark the last played item.

Parameters:
self Object Pointer
activate_item Path of the item to mark
Returns:
None

Definition at line 638 of file clMain.py.

def modules::clMain::main::setStatus (   self,
  text 
)

Sets the "Player" column of the statusbar to text.

Parameters:
self Object Pointer
text The text to set
Returns:
None

Definition at line 800 of file clMain.py.

def modules::clMain::main::show_plugins (   self,
  event = None 
)

Show the plugin dialog.

Parameters:
self Object Pointer
event Dummy param for callbacks
Returns:
None

Definition at line 393 of file clMain.py.

def modules::clMain::main::show_preferences (   self,
  widget = None,
  name = None 
)

Show the preferences dialog.

Parameters:
self OP
widget Dummy param for callbacks
name Set this for a module's / plugin's name in order to show its page on start

Definition at line 401 of file clMain.py.

def modules::clMain::main::showInfo (   self,
  path = None 
)

Set the Cover image and some other informations.

This methode is called whenever the mouse moves over the playlist.

Parameters:
self Object Pointer
path Optional path of the playlist item to set cover for. If this value is None, the currently selected item will be shown.
Returns:
None

Definition at line 599 of file clMain.py.

def modules::clMain::main::simple_database_downloader (   self,
  force_jamendo = False 
)

Downloads the database from jamendo and prints all messages to console.

Parameters:
self Object Pointer
force_jamendo If set to True the database will be downloaded directly from jamendo, if set to False, the database will be downloaded from a mirror

Definition at line 362 of file clMain.py.

def modules::clMain::main::start_pulsing (   self,
  text = "" 
)

Start pulsing the progressbar.

Parameters:
self Object Pointer
text Optional string. Will be set as text for the progressbar. Will set "" if no value is given.
Returns:
None

Definition at line 686 of file clMain.py.

def modules::clMain::main::start_timer (   self  ) 

Start the gobject timer.

This will call timer_event every 200ms

Parameters:
self Object Pointer
Returns:
None

Definition at line 677 of file clMain.py.

def modules::clMain::main::stop_pulsing (   self  ) 

Stops pulsing.

Parameters:
self Object Pointer
Returns:
None

Definition at line 708 of file clMain.py.

def modules::clMain::main::stop_timer (   self  ) 

Empty function.

Parameters:
self Object Pointer
Returns:
None

Definition at line 670 of file clMain.py.

def modules::clMain::main::switch_window_state (   self,
  ev1 = None 
)

Iconifies the window to taskbar if its shown and shows the window when its hidden.

Parameters:
self Object Pointer
ev1 Dummy param for callbacks
Returns:
None

Definition at line 820 of file clMain.py.

def modules::clMain::main::timer_event (   self  ) 

This event is called ever 200ms by start_timer().

This methods interacts with the player class and gets the current track position and some other data. It sets the current status and pulses the progressbar with pulse().

Parameters:
self Object Pointer
Returns:
True to keep the gobject timer running.

Definition at line 718 of file clMain.py.


Member Data Documentation

Switches every 200 ms to rearrange widgets if the window size changed.

Todo:
Improve since this is really ugly!

Definition at line 217 of file clMain.py.

If one sets this attrib to a string which is an file's uri, pyjama will load that file as a playlist and set this attrib to None again.

If a playlist was given:.

Definition at line 228 of file clMain.py.

clPlugin.Plugins class referenced here.

Loaded last to have any other class loaded for the plugins

Definition at line 282 of file clMain.py.

Pyjama's database setting class Use this, if you need to store many values.

Definition at line 173 of file clMain.py.


The documentation for this class was generated from the following file:

Generated on Thu Jun 4 19:08:24 2009 for Pyjama by  doxygen 1.5.8