当前位置: 首页>>代码示例>>Python>>正文


Python Tree.set_token_ring_wait_time方法代码示例

本文整理汇总了Python中Tree.set_token_ring_wait_time方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.set_token_ring_wait_time方法的具体用法?Python Tree.set_token_ring_wait_time怎么用?Python Tree.set_token_ring_wait_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree.set_token_ring_wait_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: LocationManagementApp

# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import set_token_ring_wait_time [as 别名]
class LocationManagementApp(Tkinter.Tk):
    def __init__(self,parent):
        Tkinter.Tk.__init__(self,parent)
        self.__parent = parent
        self.__tpa = None
        self.__ms1 = None
        self.__ms2 = None
        self.__canvas = None
        self.__initialize()

    ##################################################################################
    #
    #  Description: Initializes
    #
    ##################################################################################
    def __initialize(self):
        self.grid()

        self.__numLMA = Tkinter.IntVar()
        self.__numLMA.set(1)
        self.__NumLMAsOnPressEnter()

        self.reset_trees()

        self.resizable(False, False)
        self.columnconfigure(0, minsize = 250, weight=1)
        self.update()

    def clean(self):
        self.__tpa.clean()

    ##################################################################################
    #
    #  Description: Number of LMAs
    #
    ##################################################################################
    def __NumLMAsOnPressEnter(self):
        try:
            if self.__numLMA.get() > 0:
                self.__lmaNames = {}
                for i in range(self.__numLMA.get()):
                    self.__lmaNames[i] = {}
                    self.__lmaNames[i][0] = Tkinter.Label(self, text = "LMA " + str(i+1) + " Name",
                                                          anchor = "w", fg = "white", bg = "blue")
                    self.__lmaNames[i][0].grid(column = 0 , row = i, columnspan = 2, sticky = 'EW')
                    self.__lmaNames[i][1] = {}
                    self.__lmaNames[i][1][0] = Tkinter.StringVar()
                    self.__lmaNames[i][1][0].set("Values")
                    self.__lmaNames[i][1][1] = Tkinter.Entry(self, textvariable = self.__lmaNames[i][1][0], width = 20)
                    self.__lmaNames[i][1][1].grid(column = 1, row = i, sticky = 'EW')

                self.____addLMA()

        except:
            self.__numLMA.set(1)

    ##################################################################################
    #
    #  Description: adds an lma
    #
    ##################################################################################
    def ____addLMA(self):
        for i in range(self.__numLMA.get()):
            self.__lmaNames[i][0].grid_forget()
            self.__lmaNames[i][1][1].grid_forget()

        self.__labels = LocationManagementLabels(self)
        self.__lmas = []
        self.__lmaNames[i][1][0].set("")
        self.__lmas.append(LocationManagemenEntry(self, self.__lmaNames[0][1][0].get(), i+2, -1, i==0))
        self.update()

    ##################################################################################
    #
    #  Description: Resets the trees
    #
    ##################################################################################
    def reset_trees(self):
        self.__canvas = CanvasApp(self, 6, 8)
        self.__tpa = Tree(PointerAlgorithm())
        self.__ms1 = MH(1)
        self.__ms2 = MH(2)

        fill_tree(self.__tpa, self.__canvas)

        self.__ms1.add_gui(self.__canvas.add_circle(0, 0, 0, fill="white", outline="black", width=2, name="MS 1"))
        self.__tpa.put_ms_into_node_name(self.__ms1, 7)
        self.__ms2.add_gui(self.__canvas.add_circle(0, 0, 0, fill="white", outline="black", width=2, name="MS 2"))
        self.__tpa.put_ms_into_node_name(self.__ms2, 18)

    ##################################################################################
    #
    #  Description: Token Ring Wait Time
    #
    ##################################################################################
    def token_ring_wait_time(self, wait_time):
        self.__tpa.set_token_ring_wait_time(wait_time)

    ##################################################################################
    #
#.........这里部分代码省略.........
开发者ID:dntfg4,项目名称:MST6604,代码行数:103,代码来源:ProxyStrategyApp.py


注:本文中的Tree.set_token_ring_wait_time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。