Revision edf60032 examples/consoles.py

View differences:

examples/consoles.py
74 74
            "Pop up a new terminal window for a node."
75 75
            net.terms += makeTerms( [ node ], title )
76 76
        label = Button( self, text=self.node.name, command=newTerm,
77
            **self.buttonStyle )
77
                        **self.buttonStyle )
78 78
        label.pack( side='top', fill='x' )
79 79
        text = Text( self, wrap='word', **self.textStyle )
80 80
        ybar = Scrollbar( self, orient='vertical', width=7,
81
            command=text.yview )
81
                          command=text.yview )
82 82
        text.configure( yscrollcommand=ybar.set )
83 83
        text.pack( side='left', expand=True, fill='both' )
84 84
        ybar.pack( side='right', fill='y' )
......
95 95
        # way to trigger a file event handler from Tk's
96 96
        # event loop!
97 97
        self.tk.createfilehandler( self.node.stdout, READABLE,
98
            self.handleReadable )
98
                                   self.handleReadable )
99 99

  
100 100
    # We're not a terminal (yet?), so we ignore the following
101 101
    # control characters other than [\b\n\r]
......
169 169

  
170 170
    "Graph that we can add bars to over time."
171 171

  
172
    def __init__( self, parent=None,
173
            bg = 'white',
174
            gheight=200, gwidth=500,
175
            barwidth=10,
176
            ymax=3.5,):
172
    def __init__( self, parent=None, bg = 'white', gheight=200, gwidth=500,
173
                  barwidth=10, ymax=3.5,):
177 174

  
178 175
        Frame.__init__( self, parent )
179 176

  
......
195 192
        width = 25
196 193
        ymax = self.ymax
197 194
        scale = Canvas( self, width=width, height=height,
198
            background=self.bg )
195
                        background=self.bg )
199 196
        opts = { 'fill': 'red' }
200 197
        # Draw scale line
201 198
        scale.create_line( width - 1, height, width - 1, 0, **opts )
......
211 208
        ofs = 20
212 209
        height = self.gheight + ofs
213 210
        self.graph.configure( scrollregion=( 0, -ofs,
214
            self.xpos * self.barwidth, height ) )
211
                              self.xpos * self.barwidth, height ) )
215 212
        self.scale.configure( scrollregion=( 0, -ofs, 0, height ) )
216 213

  
217 214
    def yview( self, *args ):
......
231 228
        xbar = Scrollbar( self, orient='horizontal', command=graph.xview )
232 229
        ybar = Scrollbar( self, orient='vertical', command=self.yview )
233 230
        graph.configure( xscrollcommand=xbar.set, yscrollcommand=ybar.set,
234
            scrollregion=(0, 0, width, height ) )
231
                         scrollregion=(0, 0, width, height ) )
235 232
        scale.configure( yscrollcommand=ybar.set )
236 233

  
237 234
        # Layout

Also available in: Unified diff