Package client :: Package Viewers :: Module Items :: Class Region
[hide private]
[frames] | no frames]

Class Region

source code


Overview

This object is the graphical representation of one sub-Region under the RegionTree. For top-level Regions, a derived class TopRegion is used, which is mostly just named in a different manner.

To constitute a valid Region, it must have a name and shellAccess. The shellAccess is a string of the ipython command needed to access the object. Since these are not variables, their names aren't their access. Generally speaking, their shellAccess will be a traceback up the tree, with the appropriate calls. The exception to this rule is with top-level regions where their name is indeed a shellAccess, where both object attributes still exist with the same value.

Any abstract object, including this one, may have an alias. An alias is nothing more than setting a variable to an Abstract object. The point being that some arbitrarily deep buried object might have an obscene shellAccess, but the user can assign it to a variable and the GUI will realize this and accomdate for it.

These objects are created by having passed it a list of strings that identify the entire tree structure. Rather than just the information specific to this tree branch, every node linearly "under" and including this node is listed. It will find its current depth, and only generate tree items based on that depth (and tree structure "deeper"), until it has no more. All mutations to the list of strings are permanent, so once a line generates a tree item, it disposes of itself.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QTreeWidgetItem: ItemType

Instance Methods [hide private]
 
__init__(self, parent, parentShellAccess, info)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
Display(self)
This function actually sets the text to screen.
source code
 
nameMe(self, parentShellAccess, info) source code
 
isTop(self)
Returns: For sub-Regions this will always return False.
source code
 
Type(self)
Returns: For Regions, this will always return "REGION".
source code
 
setAlias(self, alias)
This method will take a given alias and set keep track of its reference to this Region.
source code
 
Delete(self)
This method will create a dialog that simply verifies that the user wishes to delete this region.
source code
 
Paste(self)
This action assumes something has been copied.
source code
 
Copy(self)
Just adds this object to the "clipboard", located on the RegionTree.
source code
 
CreateRegion(self)
This will prompt the user for a name.
source code
 
CreateGrid(self)
This will prompt the user for a name.
source code
 
CreateList(self)
This will prompt the user for a name.
source code

Inherited from PyQt4.QtGui.QTreeWidgetItem: __eq__, __ge__, __gt__, __le__, __lt__, __ne__, addChild, addChildren, background, backgroundColor, checkState, child, childCount, clone, columnCount, data, flags, font, foreground, icon, indexOfChild, insertChild, insertChildren, isExpanded, isHidden, isSelected, parent, read, setBackground, setBackgroundColor, setCheckState, setData, setExpanded, setFlags, setFont, setForeground, setHidden, setIcon, setSelected, setSizeHint, setStatusTip, setText, setTextAlignment, setTextColor, setToolTip, setWhatsThis, sizeHint, sortChildren, statusTip, takeChild, takeChildren, text, textAlignment, textColor, toolTip, treeWidget, type, whatsThis, write

Inherited from sip.wrapper: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __hash__, __reduce__, __reduce_ex__, __repr__, __str__

Class Variables [hide private]

Inherited from PyQt4.QtGui.QTreeWidgetItem: UserType

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, parentShellAccess, info)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

Display(self)

source code 

Overview

This function actually sets the text to screen. It will display the name, the fact that it is a Region, and if it exists, the alias name. Notably, this is only 3 columns where the RegionTree has 4 columns. This is because no Regions have dimensions.

nameMe(self, parentShellAccess, info)

source code 
Parameters:
  • parentShellAccess (string) - Obviously the parent's shell access which directly contributes to the child's shellAccess.
  • info (list <string>) - This is the formatted list of strings that describes the entire makeup of the tree.Information needed to determine the name is extracted from this list, and then destroyed from this list.

isTop(self)

source code 
Returns:
For sub-Regions this will always return False.

Type(self)

source code 
Returns:
For Regions, this will always return "REGION".
Overrides: Type

setAlias(self, alias)

source code 

Overview

This method will take a given alias and set keep track of its reference to this Region. No checks are made currently, as this is assumed to be done in the calling function. This should only really be done from the VariableViewer when the alias has been established.

Parameters:
  • alias (Alias) - The alias which references this object.

Delete(self)

source code 

Overview

This method will create a dialog that simply verifies that the user wishes to delete this region. Note, this deletes the actual data object behind the abstract model. The data can't be recovered after performing this action.

Paste(self)

source code 

Overview

This action assumes something has been copied. Infact it only becomes available if something has been copied. The copied abstract object is stored on the RegionTree. Regions may have other Regions, Lists, or Grids under them. If an attribute was copied, nothing will happen. After a Paste occurs, the copied object is no longer on the "clipboard".

Copy(self)

source code 

Overview

Just adds this object to the "clipboard", located on the RegionTree. Doing so will allow Pastes to occur in the menu system.

CreateRegion(self)

source code 

Overview

This will prompt the user for a name. If a valid name is given, and the dialog wasn't cancelled, this method will create an empty Region as a child of the region being represented by this abstract region.

CreateGrid(self)

source code 

Overview

This will prompt the user for a name. If a valid name is given, and the dialog wasn't cancelled, this method will create an empty Grid as a child of the region being represented by this abstract region.

CreateList(self)

source code 

Overview

This will prompt the user for a name. If a valid name is given, and the dialog wasn't cancelled, this method will create an empty List as a child of the region being represented by this abstract region.