Package peppy :: Module dired :: Class DiredMode
[frames] | no frames]

Class DiredMode

                     buffers.wx.ListCtrl --+
                                           |
                              object --+   |
                                       |   |
 lib.column_autosize.ColumnAutoSizeMixin --+
                                           |
wx.lib.mixins.listctrl.ColumnSorterMixin --+
                                           |
                          object --+       |
                                   |       |
           lib.userparams.ClassPrefs --+   |
                                       |   |
                          object --+   |   |
                                   |   |   |
                    debug.debugmixin --+   |
                                       |   |
                         major.MajorMode --+
                                           |
                                          DiredMode

Directory viewing mode

Dired is a directory viewing mode that works like an extremely bare-bones file manager.

Nested Classes
  stc_class
stc_class is used to associate this major mode with a storage mechanism (implementing the STCInterface).

Inherited from lib.userparams.ClassPrefs: __metaclass__

Instance Methods
 
__init__(self, parent, wrapper, buffer, frame)
Initialized required parameters.
 
GetListCtrl(self)
 
GetSortImages(self)
Returns a tuple of image list indexesthe indexes in the image list for an image to be put on the column header when sorting in descending order.
 
GetSecondarySortValues(self, col, key1, key2)
Returns a tuple of 2 values to use for secondary sort values when the items in the selected column match equal.
 
createListenersPostHook(self)
Hook to add custom listeners.
 
removeListenersPostHook(self)
Hook to remove custom listeners.
 
createColumns(self)
 
OnItemActivated(self, evt)
 
setSelectedIndexes(self, indexes)
Highlight the rows contained in the indexes array
 
getSelectedIndexes(self)
Return an array of indexes that are currently selected.
 
getFirstSelectedKey(self)
Get the Buffer object of the first selected item in the list.
 
moveSelected(self, dir)
Move the selection up or down.
 
getFlags(self, key)
Get the flags for the given key.
 
setFlag(self, flag)
Set the specified flag for all the selected items.
 
clearFlags(self)
Clear all flags for the selected items.
 
execute(self)
Operate on all the flags for each of the buffers.
 
getKey(self, name)
 
reset(self, msg=None, sort=False)
Reset the list.

Inherited from lib.column_autosize.ColumnAutoSizeMixin: InsertSizedColumn, ResizeColumns

Inherited from wx.lib.mixins.listctrl.ColumnSorterMixin: GetColumnSorter, GetColumnWidths, OnSortOrderChanged, SetColumnCount, SortListItems

Inherited from major.MajorMode: OnContextMenu, OnUpdateUI, OnUpdateUIHook, __del__, applySettings, createEditWindow, createEventBindings, createEventBindingsPostHook, createListeners, createPostHook, createStatusBarInfo, createStatusIcons, createWindowPostHook, deleteWindow, deleteWindowPostHook, deleteWindowPre, deleteWindowPreHook, findMinorMode, focus, focusPostHook, getIcon, getPopupActions, getStatusBarWidths, getTabName, getTitle, getWelcomeMessage, idleHandler, idlePostHook, loadMinorModesPostHook, removeListeners, removeMinibuffer, resetStatusBar, save, savePostHook, savePreHook, setMinibuffer, setStatusText, settingsChanged, showBusy, showInitialPosition, showModified, tabActivatedHook, updateAui

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

Class Methods
 
verifyProtocol(cls, url)
Hook to short-circuit the mode matching heuristics.

Inherited from major.MajorMode: verifyEditraType, verifyFilename, verifyMagic, verifyMetadata, verifyMimetype

Inherited from debug.debugmixin: dprint

Class Variables
  keyword = "Dired"
The single-word keyword representing this major mode
  icon = 'icons/folder_explore.png'
Pointer to the icon representing this major mode
  allow_threaded_loading = False
If this mode allows threading loading, set this True

Inherited from major.MajorMode: classprefs, debuglevel, default_classprefs, emacs_synonyms, localkeymaps, mimetype, preferences_tab, regex, temporary

Inherited from lib.userparams.ClassPrefs: preferences_sort_weight

Properties

Inherited from object: __class__

Method Details

verifyProtocol(cls, url)
Class Method

 

Hook to short-circuit the mode matching heuristics.

For non-editing applications and client applications that connect to a server, this hook provides the ability to short-circuit the matching process and open a mode immediately.

This method must not attempt to open the url and read any data. All modes' verifyProtocol methods are called before the file is attempted to be opened, and attempting to read data here could mess up streaming files.

Parameters:
  • url - vfs.Reference object
Returns:
True to short circuit and use this mode.
Overrides: major.MajorMode.verifyProtocol
(inherited documentation)

__init__(self, parent, wrapper, buffer, frame)
(Constructor)

 

Initialized required parameters.

This constructor must be called within the init method of the associated ListCtrl class using this mixin in order to set up some required parameters.

If the automatic scaling is used in response to user resize events and the ListCtrl class also binds the wx.EVT_SIZE event, it will have to manually call the mixin's OnSize method, otherwise the mixin will not automatically resize the columns in the list.

Keyword arguments recognized:

resize: True/False value indicating if the wx.EVT_SIZE event should be caught and the list columns should be resized in response to the user resizing the window. (Default is True)

Overrides: object.__init__
(inherited documentation)

GetSortImages(self)

 

Returns a tuple of image list indexesthe indexes in the image list for an image to be put on the column header when sorting in descending order.

Overrides: wx.lib.mixins.listctrl.ColumnSorterMixin.GetSortImages
(inherited documentation)

GetSecondarySortValues(self, col, key1, key2)

 

Returns a tuple of 2 values to use for secondary sort values when the items in the selected column match equal. The default just returns the item data values.

Overrides: wx.lib.mixins.listctrl.ColumnSorterMixin.GetSecondarySortValues
(inherited documentation)

createListenersPostHook(self)

 

Hook to add custom listeners.

Subclasses should override this method rather than createListeners to add their own listeners.

Overrides: major.MajorMode.createListenersPostHook
(inherited documentation)

removeListenersPostHook(self)

 

Hook to remove custom listeners.

Any listeners added by subclasses in createListenersPostHook should be removed here.

Overrides: major.MajorMode.removeListenersPostHook
(inherited documentation)

moveSelected(self, dir)

 

Move the selection up or down.

If dir < 0, move the selection to the item before the first currently selected item, and if dir > 0 move the selection to after the last item that is currently selected.

getFlags(self, key)

 

Get the flags for the given key.

If the key has not been seen before, create an initial state for those flags (which is all flags cleared) and return that.

setFlag(self, flag)

 

Set the specified flag for all the selected items.

flag: a single character representing the flag to set

execute(self)

 

Operate on all the flags for each of the buffers.

For each buffer item, process the flags to perform the requested action.

reset(self, msg=None, sort=False)

 

Reset the list.

No optimization here, just rebuild the entire list.