Package peppy :: Module main :: Class Peppy
[frames] | no frames]

Class Peppy

    lib.processmanager.wx.App --+
                                |
                   object --+   |
                            |   |
    lib.userparams.ClassPrefs --+
                                |
                   object --+   |
                            |   |
lib.processmanager.debugmixin --+
                                |
                               Peppy

Main application object.

This handles the initialization of the debug parameters for objects and loads the configuration file, plugins, configures the initial keyboard mapping, and other lower level initialization from the BufferApp superclass.

Nested Classes

Inherited from lib.userparams.ClassPrefs: __metaclass__

Instance Methods
 
OnInit(self)
Main application initialization.
 
OnIdle(self, evt)
Application-wide idle update events are processed here.
 
bootstrapCommandLineOptions(self)
Process a small number of configuration options before plugins are loaded.
 
getOptionParser(self)
 
processCommandLineOptions(self)
Process the bulk of the command line options.
 
setVerboseLevel(self, kls)
Set the class's debuglevel if the verbosity level is high enough.
 
setVerbosity(self, menu=None, reset=False)
Find all classes that use the debugmixin and set the logging level to the value of verbose.
 
findRunningServer(self)
Determine if a single instance server is running.
 
getServerPort(self, lo=50000, hi=60000, tries=10)
Determine the port to use for the load file server.
 
startServer(self)
 
otherInstanceRunning(self)
 
sendToOtherInstance(self, filename)
 
loadRemoteArgs(self, arg)
 
getConfigFilePath(self, filename)
 
loadConfig(self)
 
loadConfigFile(self, filename)
 
startSplash(self)
 
stopSplash(self)
 
saveConfig(self, filename)
 
countImports(self)
 
autoloadImports(self)
 
gaugeCallback(self, plugin_info)
 
countYapsyPlugins(self)
Autoload plugins from peppy plugins directory.
 
autoloadYapsyPlugins(self)
Autoload plugins from peppy plugins directory.
 
activatePlugins(self)
 
autoloadSetuptoolsPlugins(self, entry_point='peppy.plugins')
Autoload setuptools plugins.
 
initGraphics(self)
 
deleteFrame(self, frame)
 
showFrame(self, frame)
 
getTopFrame(self)
 
MacOpenFile(self, filename)
OSX specific routine to handle files that are dropped on the icon
 
enableFrames(self)
Force all frames to update their enable status.
 
updateAllFrames(self)
Recreate the UI for all frames.
 
close(self, buffer)
 
quit(self)
 
quitHook(self)
 
GetLog(self)
Return logger for Editra compatibility.
 
cooperativeYield(self)
Make sure you don't try to wx.Yield inside another wx.Yield

Inherited from lib.processmanager.debugmixin: dprint

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  verbose = 0
  options = {}
  args = []
  icon = "icons/peppy.png"
  base_preferences = "preferences.cfg"
  override_preferences = "peppy.cfg"
  standard_plugin_dirs = ['plugins', 'hsi']
  preferences_plugin_dir = "plugins"
  server_port_filename = ".server.port"
  verboselevel = {'.*Frame': 2, 'ActionMenu.*': 4, 'ActionTool.*...
  minimal_config = {'BufferFrame': {'width': 700, 'height': 700,...
  preferences_tab = "General"
  preferences_sort_weight = 0
Sorting weight (from 0 to 1000) if you want to group items out of the
  default_classprefs = StrParam('plugin_search_path', 'plugins',...
  mouse = Mouse()
  user = User()
  tabs = Tabs()
  language = Language()
  config = None
  yielding = False

Inherited from lib.userparams.ClassPrefs: classprefs

Inherited from lib.processmanager.debugmixin: debuglevel

Properties

Inherited from object: __class__

Method Details

OnInit(self)

 

Main application initialization.

Called by the wx framework and used instead of the __init__ method in a wx application.

bootstrapCommandLineOptions(self)

 

Process a small number of configuration options before plugins are loaded.

Plugins can also define command line options, which obviously delays full command line processing until plugins are loaded. However, a few options must be parsed before further processing takes place. These are processed here.

processCommandLineOptions(self)

 

Process the bulk of the command line options.

Because eventually it will be possible to load command line options from plugins, most of the command line parsing happens after plugins are loaded. The bootstrap options are repeated here so that a usage statement will show the options.

setVerboseLevel(self, kls)

 

Set the class's debuglevel if the verbosity level is high enough. Matches the class name against list of regular expressions in verboselevel to see if extra verbosity is needed to turn on debugging output for that class.

Parameters:
  • kls - class
  • type - subclass of debugmixin

setVerbosity(self, menu=None, reset=False)

 

Find all classes that use the debugmixin and set the logging level to the value of verbose.

Parameters:
  • menu (DebugClass instance, or None) - if set, the value of the menu to populate

findRunningServer(self)

 

Determine if a single instance server is running.

If the server port specification file exists, try to open that file to determine the port that is being used by the other running instance.

getServerPort(self, lo=50000, hi=60000, tries=10)

 

Determine the port to use for the load file server.

Find a port that is open (i.e. that doesn't respond when trying to open it) in the specified range and return a LoadFileProxy for it.

countYapsyPlugins(self)

 

Autoload plugins from peppy plugins directory.

All .py files that exist in the peppy.plugins directory are loaded here. Currently uses a naive approach by loading them in the order returned by os.listdir. No dependency ordering is done.

autoloadYapsyPlugins(self)

 

Autoload plugins from peppy plugins directory.

All .py files that exist in the peppy.plugins directory are loaded here. Currently uses a naive approach by loading them in the order returned by os.listdir. No dependency ordering is done.

autoloadSetuptoolsPlugins(self, entry_point='peppy.plugins')

 

Autoload setuptools plugins.

All setuptools plugins with the peppy entry point are loaded here, if setuptools is installed.

enableFrames(self)

 

Force all frames to update their enable status.

Loop through each frame and force an update of the enable/disable state of ui items. The menu does this in response to a user event, so this is really for the toolbar and other always-visible widgets that aren't automatically updated.

updateAllFrames(self)

 

Recreate the UI for all frames.

Loop through each frame and force an update of the entire UI. This is useful after changing languages to force the menubar to be redrawn in the new language.

cooperativeYield(self)

 

Make sure you don't try to wx.Yield inside another wx.Yield

wx.Yield doesn't like being called by another function when it's in the middle of another yield, so guard against that by using this barrier.


Class Variable Details

verboselevel

Value:
{'.*Frame': 2, 'ActionMenu.*': 4, 'ActionTool.*': 4, '.*Filter': 3,}

minimal_config

Value:
{'BufferFrame': {'width': 700, 'height': 700, 'sidebars': 'filebrowser\
, debug_log, error_log, info_log, processes',},}

default_classprefs

Value:
StrParam('plugin_search_path', 'plugins', 'os.pathsep separated list o\
f paths to search\nfor additional plugins'), StrParam('title_page', 'a\
bout:peppy', 'URL of page to load when no other file\n is loaded'), Bo\
olParam('request_server', True, 'Force peppy to send file open request\
s to\nan already running copy of peppy'), BoolParam('requests_in_new_f\
rame', True, 'File open requests will appear in\na new frame if True, \
or as a new tab in\nan existing frame if False'), IntParam('binary_per\
centage', 10, 'Percentage of non-displayable characters that results\n\
...