SILENT KILLERPanel

Current Path: > > opt > alt > python34 > lib64 > > python3.4 > idlelib


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/alt/python34/lib64//python3.4/idlelib

NameTypeSizeLast ModifiedActions
Icons Directory - -
__pycache__ Directory - -
idle_test Directory - -
AutoComplete.py File 9202 bytes April 17 2024 17:09:57.
AutoCompleteWindow.py File 17739 bytes April 17 2024 17:09:57.
AutoExpand.py File 3395 bytes April 17 2024 17:09:57.
Bindings.py File 3046 bytes April 17 2024 17:09:57.
CREDITS.txt File 1865 bytes March 18 2019 16:51:26.
CallTipWindow.py File 6034 bytes April 17 2024 17:09:57.
CallTips.py File 5932 bytes April 17 2024 17:09:57.
ChangeLog File 56393 bytes March 18 2019 16:51:26.
ClassBrowser.py File 6999 bytes April 17 2024 17:09:58.
CodeContext.py File 8348 bytes April 17 2024 17:09:57.
ColorDelegator.py File 9695 bytes April 17 2024 17:09:57.
Debugger.py File 18759 bytes April 17 2024 17:09:57.
Delegator.py File 665 bytes April 17 2024 17:09:57.
EditorWindow.py File 66059 bytes April 17 2024 17:09:57.
FileList.py File 3813 bytes April 17 2024 17:09:57.
FormatParagraph.py File 7287 bytes April 17 2024 17:09:58.
GrepDialog.py File 5124 bytes April 17 2024 17:09:58.
HISTORY.txt File 10317 bytes March 18 2019 16:51:26.
HyperParser.py File 12877 bytes April 17 2024 17:09:57.
IOBinding.py File 19773 bytes April 17 2024 17:09:57.
IdleHistory.py File 4052 bytes April 17 2024 17:09:58.
MultiCall.py File 18571 bytes April 17 2024 17:09:57.
MultiStatusBar.py File 1348 bytes April 17 2024 17:09:57.
NEWS.txt File 39835 bytes March 18 2019 16:51:26.
ObjectBrowser.py File 3975 bytes April 17 2024 17:09:57.
OutputWindow.py File 4394 bytes April 17 2024 17:09:58.
ParenMatch.py File 6713 bytes April 17 2024 17:09:57.
PathBrowser.py File 3207 bytes April 17 2024 17:09:57.
Percolator.py File 3244 bytes April 17 2024 17:09:58.
PyParse.py File 20461 bytes April 17 2024 17:09:57.
PyShell.py File 58450 bytes April 17 2024 17:09:57.
README.txt File 7709 bytes March 18 2019 16:51:26.
RemoteDebugger.py File 12007 bytes April 17 2024 17:09:57.
RemoteObjectBrowser.py File 964 bytes April 17 2024 17:09:57.
ReplaceDialog.py File 6640 bytes April 17 2024 17:09:57.
RstripExtension.py File 1050 bytes April 17 2024 17:09:57.
ScriptBinding.py File 8061 bytes April 17 2024 17:09:57.
ScrolledList.py File 4375 bytes April 17 2024 17:09:57.
SearchDialog.py File 2630 bytes April 17 2024 17:09:57.
SearchDialogBase.py File 7009 bytes April 17 2024 17:09:57.
SearchEngine.py File 7485 bytes April 17 2024 17:09:58.
StackViewer.py File 4426 bytes April 17 2024 17:09:58.
TODO.txt File 8478 bytes March 18 2019 16:51:26.
ToolTip.py File 3173 bytes April 17 2024 17:09:58.
TreeWidget.py File 15024 bytes April 17 2024 17:09:57.
UndoDelegator.py File 10815 bytes April 17 2024 17:09:57.
WidgetRedirector.py File 6869 bytes April 17 2024 17:09:57.
WindowList.py File 2472 bytes April 17 2024 17:09:57.
ZoomHeight.py File 1300 bytes April 17 2024 17:09:58.
__init__.py File 288 bytes April 17 2024 17:09:57.
__main__.py File 159 bytes April 17 2024 17:09:57.
aboutDialog.py File 6688 bytes April 17 2024 17:09:57.
config-extensions.def File 2965 bytes March 18 2019 16:51:26.
config-highlight.def File 2515 bytes March 18 2019 16:51:26.
config-keys.def File 7777 bytes March 18 2019 16:51:26.
config-main.def File 2563 bytes March 18 2019 16:51:26.
configDialog.py File 64305 bytes April 17 2024 17:09:57.
configHandler.py File 32197 bytes April 17 2024 17:09:57.
configHelpSourceEdit.py File 6670 bytes April 17 2024 17:09:57.
configSectionNameDialog.py File 4007 bytes April 17 2024 17:09:57.
dynOptionMenuWidget.py File 1990 bytes April 17 2024 17:09:57.
extend.txt File 3642 bytes March 18 2019 16:51:26.
help.html File 41126 bytes March 18 2019 16:51:26.
help.py File 9701 bytes April 17 2024 17:09:57.
help.txt File 17900 bytes March 18 2019 16:51:26.
idle.py File 400 bytes April 17 2024 17:09:57.
idle.pyw File 570 bytes March 18 2019 16:51:26.
idlever.py File 415 bytes April 17 2024 17:09:57.
keybindingDialog.py File 12416 bytes April 17 2024 17:09:57.
macosxSupport.py File 8684 bytes April 17 2024 17:09:57.
rpc.py File 20782 bytes April 17 2024 17:09:57.
run.py File 13673 bytes April 17 2024 17:09:57.
tabbedpages.py File 18418 bytes April 17 2024 17:09:57.
textView.py File 3225 bytes April 17 2024 17:09:57.

Reading File: //opt/alt/python34/lib64//python3.4/idlelib/ObjectBrowser.py

# XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - more doc strings
# - tooltips

# object browser

# XXX TO DO:
# - for classes/modules, add "open source" to object browser

import re

from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas

from reprlib import Repr

myrepr = Repr()
myrepr.maxstring = 100
myrepr.maxother = 100

class ObjectTreeItem(TreeItem):
    def __init__(self, labeltext, object, setfunction=None):
        self.labeltext = labeltext
        self.object = object
        self.setfunction = setfunction
    def GetLabelText(self):
        return self.labeltext
    def GetText(self):
        return myrepr.repr(self.object)
    def GetIconName(self):
        if not self.IsExpandable():
            return "python"
    def IsEditable(self):
        return self.setfunction is not None
    def SetText(self, text):
        try:
            value = eval(text)
            self.setfunction(value)
        except:
            pass
        else:
            self.object = value
    def IsExpandable(self):
        return not not dir(self.object)
    def GetSubList(self):
        keys = dir(self.object)
        sublist = []
        for key in keys:
            try:
                value = getattr(self.object, key)
            except AttributeError:
                continue
            item = make_objecttreeitem(
                str(key) + " =",
                value,
                lambda value, key=key, object=self.object:
                    setattr(object, key, value))
            sublist.append(item)
        return sublist

class ClassTreeItem(ObjectTreeItem):
    def IsExpandable(self):
        return True
    def GetSubList(self):
        sublist = ObjectTreeItem.GetSubList(self)
        if len(self.object.__bases__) == 1:
            item = make_objecttreeitem("__bases__[0] =",
                self.object.__bases__[0])
        else:
            item = make_objecttreeitem("__bases__ =", self.object.__bases__)
        sublist.insert(0, item)
        return sublist

class AtomicObjectTreeItem(ObjectTreeItem):
    def IsExpandable(self):
        return 0

class SequenceTreeItem(ObjectTreeItem):
    def IsExpandable(self):
        return len(self.object) > 0
    def keys(self):
        return range(len(self.object))
    def GetSubList(self):
        sublist = []
        for key in self.keys():
            try:
                value = self.object[key]
            except KeyError:
                continue
            def setfunction(value, key=key, object=self.object):
                object[key] = value
            item = make_objecttreeitem("%r:" % (key,), value, setfunction)
            sublist.append(item)
        return sublist

class DictTreeItem(SequenceTreeItem):
    def keys(self):
        keys = list(self.object.keys())
        try:
            keys.sort()
        except:
            pass
        return keys

dispatch = {
    int: AtomicObjectTreeItem,
    float: AtomicObjectTreeItem,
    str: AtomicObjectTreeItem,
    tuple: SequenceTreeItem,
    list: SequenceTreeItem,
    dict: DictTreeItem,
    type: ClassTreeItem,
}

def make_objecttreeitem(labeltext, object, setfunction=None):
    t = type(object)
    if t in dispatch:
        c = dispatch[t]
    else:
        c = ObjectTreeItem
    return c(labeltext, object, setfunction)


def _object_browser(parent):
    import sys
    from tkinter import Tk
    root = Tk()
    root.title("Test ObjectBrowser")
    width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
    root.geometry("+%d+%d"%(x, y + 150))
    root.configure(bd=0, bg="yellow")
    root.focus_set()
    sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
    sc.frame.pack(expand=1, fill="both")
    item = make_objecttreeitem("sys", sys)
    node = TreeNode(sc.canvas, None, item)
    node.update()
    root.mainloop()

if __name__ == '__main__':
    from idlelib.idle_test.htest import run
    run(_object_browser)

SILENT KILLER Tool