Psyduck - 可達鴨 之 鴨力山大2


Server : LiteSpeed
System : Linux premium217.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : alloknri ( 880)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /opt/alt/python33/lib64/python3.3/idlelib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python33/lib64/python3.3/idlelib/StackViewer.py
import os
import sys
import linecache

from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem

def StackBrowser(root, flist=None, tb=None, top=None):
    if top is None:
        from tkinter import Toplevel
        top = Toplevel(root)
    sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
    sc.frame.pack(expand=1, fill="both")
    item = StackTreeItem(flist, tb)
    node = TreeNode(sc.canvas, None, item)
    node.expand()

class StackTreeItem(TreeItem):

    def __init__(self, flist=None, tb=None):
        self.flist = flist
        self.stack = self.get_stack(tb)
        self.text = self.get_exception()

    def get_stack(self, tb):
        if tb is None:
            tb = sys.last_traceback
        stack = []
        if tb and tb.tb_frame is None:
            tb = tb.tb_next
        while tb is not None:
            stack.append((tb.tb_frame, tb.tb_lineno))
            tb = tb.tb_next
        return stack

    def get_exception(self):
        type = sys.last_type
        value = sys.last_value
        if hasattr(type, "__name__"):
            type = type.__name__
        s = str(type)
        if value is not None:
            s = s + ": " + str(value)
        return s

    def GetText(self):
        return self.text

    def GetSubList(self):
        sublist = []
        for info in self.stack:
            item = FrameTreeItem(info, self.flist)
            sublist.append(item)
        return sublist

class FrameTreeItem(TreeItem):

    def __init__(self, info, flist):
        self.info = info
        self.flist = flist

    def GetText(self):
        frame, lineno = self.info
        try:
            modname = frame.f_globals["__name__"]
        except:
            modname = "?"
        code = frame.f_code
        filename = code.co_filename
        funcname = code.co_name
        sourceline = linecache.getline(filename, lineno)
        sourceline = sourceline.strip()
        if funcname in ("?", "", None):
            item = "%s, line %d: %s" % (modname, lineno, sourceline)
        else:
            item = "%s.%s(...), line %d: %s" % (modname, funcname,
                                             lineno, sourceline)
        return item

    def GetSubList(self):
        frame, lineno = self.info
        sublist = []
        if frame.f_globals is not frame.f_locals:
            item = VariablesTreeItem("<locals>", frame.f_locals, self.flist)
            sublist.append(item)
        item = VariablesTreeItem("<globals>", frame.f_globals, self.flist)
        sublist.append(item)
        return sublist

    def OnDoubleClick(self):
        if self.flist:
            frame, lineno = self.info
            filename = frame.f_code.co_filename
            if os.path.isfile(filename):
                self.flist.gotofileline(filename, lineno)

class VariablesTreeItem(ObjectTreeItem):

    def GetText(self):
        return self.labeltext

    def GetLabelText(self):
        return None

    def IsExpandable(self):
        return len(self.object) > 0

    def keys(self):
        return list(self.object.keys())

    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(key + " =", value, setfunction)
            sublist.append(item)
        return sublist
Name
Size
Permissions
Options
Icons
--
drwxr-xr-x
__pycache__
--
drwxr-xr-x
idle_test
--
drwxr-xr-x
AutoComplete.py
8.869 KB
-rw-r--r--
AutoCompleteWindow.py
17.258 KB
-rw-r--r--
AutoExpand.py
2.425 KB
-rw-r--r--
Bindings.py
3.354 KB
-rw-r--r--
CREDITS.txt
1.821 KB
-rw-r--r--
CallTipWindow.py
5.761 KB
-rw-r--r--
CallTips.py
5.793 KB
-rw-r--r--
ChangeLog
55.071 KB
-rw-r--r--
ClassBrowser.py
6.222 KB
-rw-r--r--
CodeContext.py
8.157 KB
-rw-r--r--
ColorDelegator.py
10.222 KB
-rw-r--r--
Debugger.py
15.983 KB
-rw-r--r--
Delegator.py
0.649 KB
-rw-r--r--
EditorWindow.py
64.753 KB
-rw-r--r--
FileList.py
3.725 KB
-rw-r--r--
FormatParagraph.py
6.998 KB
-rw-r--r--
GrepDialog.py
4.015 KB
-rw-r--r--
HISTORY.txt
10.075 KB
-rw-r--r--
HyperParser.py
10.314 KB
-rw-r--r--
IOBinding.py
19.396 KB
-rw-r--r--
IdleHistory.py
4.021 KB
-rw-r--r--
MultiCall.py
17.118 KB
-rw-r--r--
MultiStatusBar.py
0.765 KB
-rw-r--r--
NEWS.txt
33.61 KB
-rw-r--r--
ObjectBrowser.py
3.661 KB
-rw-r--r--
OutputWindow.py
4.291 KB
-rw-r--r--
ParenMatch.py
6.472 KB
-rw-r--r--
PathBrowser.py
2.811 KB
-rw-r--r--
Percolator.py
2.596 KB
-rw-r--r--
PyParse.py
18.959 KB
-rw-r--r--
PyShell.py
56.521 KB
-rwxr-xr-x
README.txt
2.443 KB
-rw-r--r--
RemoteDebugger.py
11.747 KB
-rw-r--r--
RemoteObjectBrowser.py
0.941 KB
-rw-r--r--
ReplaceDialog.py
5.692 KB
-rw-r--r--
RstripExtension.py
1.025 KB
-rw-r--r--
ScriptBinding.py
7.88 KB
-rw-r--r--
ScrolledList.py
3.903 KB
-rw-r--r--
SearchDialog.py
1.969 KB
-rw-r--r--
SearchDialogBase.py
5.063 KB
-rw-r--r--
SearchEngine.py
7.367 KB
-rw-r--r--
StackViewer.py
3.483 KB
-rw-r--r--
TODO.txt
8.279 KB
-rw-r--r--
ToolTip.py
2.672 KB
-rw-r--r--
TreeWidget.py
14.863 KB
-rw-r--r--
UndoDelegator.py
10.063 KB
-rw-r--r--
WidgetRedirector.py
4.372 KB
-rw-r--r--
WindowList.py
2.414 KB
-rw-r--r--
ZoomHeight.py
1.276 KB
-rw-r--r--
__init__.py
0.036 KB
-rw-r--r--
__main__.py
0.106 KB
-rw-r--r--
aboutDialog.py
6.421 KB
-rw-r--r--
config-extensions.def
2.723 KB
-rw-r--r--
config-highlight.def
1.699 KB
-rw-r--r--
config-keys.def
7.348 KB
-rw-r--r--
config-main.def
2.455 KB
-rw-r--r--
configDialog.py
51.611 KB
-rw-r--r--
configHandler.py
28.636 KB
-rw-r--r--
configHelpSourceEdit.py
6.567 KB
-rw-r--r--
configSectionNameDialog.py
4.213 KB
-rw-r--r--
dynOptionMenuWidget.py
1.277 KB
-rw-r--r--
extend.txt
3.557 KB
-rw-r--r--
help.txt
11.713 KB
-rw-r--r--
idle.py
0.391 KB
-rw-r--r--
idle.pyw
0.655 KB
-rw-r--r--
idlever.py
0.022 KB
-rw-r--r--
keybindingDialog.py
12.136 KB
-rw-r--r--
macosxSupport.py
7.004 KB
-rw-r--r--
rpc.py
20.462 KB
-rw-r--r--
run.py
13.373 KB
-rw-r--r--
tabbedpages.py
17.741 KB
-rw-r--r--
textView.py
3.462 KB
-rw-r--r--