diff options
Diffstat (limited to 'grc/gui')
-rw-r--r-- | grc/gui/ActionHandler.py | 30 | ||||
-rw-r--r-- | grc/gui/Actions.py | 4 | ||||
-rw-r--r-- | grc/gui/Block.py | 16 | ||||
-rw-r--r-- | grc/gui/Connection.py | 6 | ||||
-rw-r--r-- | grc/gui/Dialogs.py | 8 | ||||
-rw-r--r-- | grc/gui/DrawingArea.py | 2 | ||||
-rw-r--r-- | grc/gui/Element.py | 36 | ||||
-rw-r--r-- | grc/gui/FileDialogs.py | 10 | ||||
-rw-r--r-- | grc/gui/FlowGraph.py | 40 | ||||
-rw-r--r-- | grc/gui/MainWindow.py | 26 | ||||
-rw-r--r-- | grc/gui/Messages.py | 4 | ||||
-rw-r--r-- | grc/gui/NotebookPage.py | 28 | ||||
-rw-r--r-- | grc/gui/Param.py | 4 | ||||
-rw-r--r-- | grc/gui/Port.py | 22 | ||||
-rw-r--r-- | grc/gui/PropsDialog.py | 12 | ||||
-rw-r--r-- | grc/gui/StateCache.py | 10 | ||||
-rw-r--r-- | grc/gui/Utils.py | 14 |
17 files changed, 136 insertions, 136 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 65969e0d6f..1db333fc5a 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -49,7 +49,7 @@ class ActionHandler: ActionHandler constructor. Create the main window, setup the message handler, import the preferences, and connect all of the action handlers. Finally, enter the gtk main loop and block. - + Args: file_paths: a list of flow graph file passed from command line platform: platform module @@ -81,7 +81,7 @@ class ActionHandler: * some keys are ignored by the accelerators like the direction keys, * some keys are not registered to any accelerators but are still used. When not in focus, gtk and the accelerators handle the the key press. - + Returns: false to let gtk handle the key action """ @@ -95,7 +95,7 @@ class ActionHandler: Handle the delete event from the main window. Generated by pressing X to close, alt+f4, or right click+close. This method in turns calls the state handler to quit. - + Returns: true """ @@ -174,14 +174,14 @@ class ActionHandler: self.get_page().get_state_cache().save_new_state(self.get_flow_graph().export_data()) self.get_page().set_saved(False) ################################################## - # Create heir block + # Create heir block ################################################## elif action == Actions.BLOCK_CREATE_HIER: # keeping track of coordinates for pasting later coords = self.get_flow_graph().get_selected_blocks()[0].get_coordinate() x,y = coords - x_min = x + x_min = x y_min = y pads = []; @@ -200,9 +200,9 @@ class ActionHandler: # If a block parameter exists that is a parameter, create a parameter for it if param.get_value() == flow_param.get_id(): params.append(param.get_value()) - - - # keep track of x,y mins for pasting later + + + # keep track of x,y mins for pasting later (x,y) = block.get_coordinate() if x < x_min: x_min = x @@ -214,8 +214,8 @@ class ActionHandler: # Get id of connected blocks source_id = connection.get_source().get_parent().get_id() sink_id = connection.get_sink().get_parent().get_id() - - # If connected block is not in the list of selected blocks create a pad for it + + # If connected block is not in the list of selected blocks create a pad for it if self.get_flow_graph().get_block(source_id) not in self.get_flow_graph().get_selected_blocks(): pads.append({'key': connection.get_sink().get_key(), 'coord': connection.get_source().get_coordinate(), 'block_id' : block.get_id(), 'direction': 'source'}) @@ -241,7 +241,7 @@ class ActionHandler: # Remove the default samp_rate variable block that is created remove_me = self.get_flow_graph().get_block("samp_rate") - self.get_flow_graph().remove_element(remove_me) + self.get_flow_graph().remove_element(remove_me) # Add the param blocks along the top of the window @@ -297,9 +297,9 @@ class ActionHandler: # Connect the pad to the proper sinks new_connection = self.get_flow_graph().connect(pad_source,sink) - # update the new heir block flow graph + # update the new heir block flow graph self.get_flow_graph().update() - + ################################################## # Move/Rotate/Delete/Create @@ -495,7 +495,7 @@ class ActionHandler: self.get_flow_graph()._old_selected_port = None self.get_flow_graph()._new_selected_port = None Actions.ELEMENT_CREATE() - + elif action == Actions.BUSSIFY_SINKS: n = {'name':'bus', 'type':'bus'} for b in self.get_flow_graph().get_selected_blocks(): @@ -563,7 +563,7 @@ class ExecFlowGraphThread(Thread): def __init__ (self, action_handler): """ ExecFlowGraphThread constructor. - + Args: action_handler: an instance of an ActionHandler """ diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py index f633e7ced0..af07121f3a 100644 --- a/grc/gui/Actions.py +++ b/grc/gui/Actions.py @@ -33,10 +33,10 @@ def handle_key_press(event): """ Call the action associated with the key press event. Both the key value and the mask must have a match. - + Args: event: a gtk key press event - + Returns: true if handled """ diff --git a/grc/gui/Block.py b/grc/gui/Block.py index b2b391246e..49c0361eb9 100644 --- a/grc/gui/Block.py +++ b/grc/gui/Block.py @@ -69,7 +69,7 @@ class Block(Element): def get_coordinate(self): """ Get the coordinate from the position param. - + Returns: the coordinate tuple (x, y) or (0, 0) if failure """ @@ -93,7 +93,7 @@ class Block(Element): def set_coordinate(self, coor): """ Set the coordinate into the position param. - + Args: coor: the coordinate tuple (x, y) """ @@ -102,7 +102,7 @@ class Block(Element): def get_rotation(self): """ Get the rotation from the position param. - + Returns: the rotation in degrees or 0 if failure """ @@ -116,7 +116,7 @@ class Block(Element): def set_rotation(self, rot): """ Set the rotation into the position param. - + Args: rot: the rotation in degrees """ @@ -177,7 +177,7 @@ class Block(Element): self.H = max(*( [self.label_height+2*BLOCK_LABEL_PADDING] + [2*PORT_BORDER_SEPARATION + \ sum([port.H + PORT_SEPARATION for port in ports]) - PORT_SEPARATION - for ports in (self.get_sources_gui(), self.get_sinks_gui())] + + for ports in (self.get_sources_gui(), self.get_sinks_gui())] + [4*PORT_BORDER_SEPARATION + \ sum([(port.H) + PORT_SEPARATION for port in ports]) - PORT_SEPARATION for ports in ([i for i in self.get_sources_gui() if i.get_type() == 'bus'], [i for i in self.get_sinks_gui() if i.get_type() == 'bus'])] @@ -186,7 +186,7 @@ class Block(Element): def draw(self, gc, window): """ Draw the signal block with label and inputs/outputs. - + Args: gc: the graphics context window: the gtk window to draw on @@ -210,11 +210,11 @@ class Block(Element): def what_is_selected(self, coor, coor_m=None): """ Get the element that is selected. - + Args: coor: the (x,y) tuple coor_m: the (x_m, y_m) tuple - + Returns: this block, a port, or None """ diff --git a/grc/gui/Connection.py b/grc/gui/Connection.py index 3410e3a93b..5f95c99a0b 100644 --- a/grc/gui/Connection.py +++ b/grc/gui/Connection.py @@ -39,7 +39,7 @@ class Connection(Element): """ Get the 0,0 coordinate. Coordinates are irrelevant in connection. - + Returns: 0, 0 """ @@ -49,7 +49,7 @@ class Connection(Element): """ Get the 0 degree rotation. Rotations are irrelevant in connection. - + Returns: 0 """ @@ -128,7 +128,7 @@ class Connection(Element): def draw(self, gc, window): """ Draw the connection. - + Args: gc: the graphics context window: the gtk window to draw on diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index 04e4f0a862..873bac9783 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -28,7 +28,7 @@ class TextDisplay(gtk.TextView): def __init__(self, text=''): """ TextDisplay constructor. - + Args: text: the text to display (string) """ @@ -64,16 +64,16 @@ class TextDisplay(gtk.TextView): def MessageDialogHelper(type, buttons, title=None, markup=None): """ Create a modal message dialog and run it. - + Args: type: the type of message: gtk.MESSAGE_INFO, gtk.MESSAGE_WARNING, gtk.MESSAGE_QUESTION or gtk.MESSAGE_ERROR buttons: the predefined set of buttons to use: gtk.BUTTONS_NONE, gtk.BUTTONS_OK, gtk.BUTTONS_CLOSE, gtk.BUTTONS_CANCEL, gtk.BUTTONS_YES_NO, gtk.BUTTONS_OK_CANCEL - + Args: tittle: the title of the window (string) markup: the message text with pango markup - + Returns: the gtk response from run() """ diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py index 05e69e7bc6..448948e7f4 100644 --- a/grc/gui/DrawingArea.py +++ b/grc/gui/DrawingArea.py @@ -32,7 +32,7 @@ class DrawingArea(gtk.DrawingArea): """ DrawingArea contructor. Connect event handlers. - + Args: main_window: the main_window containing all flow graphs """ diff --git a/grc/gui/Element.py b/grc/gui/Element.py index 915bdfb915..c43f0eb35c 100644 --- a/grc/gui/Element.py +++ b/grc/gui/Element.py @@ -40,10 +40,10 @@ class Element(object): """ Is this element horizontal? If rotation is None, use this element's rotation. - + Args: rotation: the optional rotation - + Returns: true if rotation is horizontal """ @@ -54,10 +54,10 @@ class Element(object): """ Is this element vertical? If rotation is None, use this element's rotation. - + Args: rotation: the optional rotation - + Returns: true if rotation is vertical """ @@ -82,7 +82,7 @@ class Element(object): def draw(self, gc, window, border_color, bg_color): """ Draw in the given window. - + Args: gc: the graphics context window: the gtk window to draw on @@ -104,7 +104,7 @@ class Element(object): def rotate(self, rotation): """ Rotate all of the areas by 90 degrees. - + Args: rotation: multiple of 90 degrees """ @@ -118,7 +118,7 @@ class Element(object): def set_coordinate(self, coor): """ Set the reference coordinate. - + Args: coor: the coordinate tuple (x,y) """ @@ -127,7 +127,7 @@ class Element(object): def get_parent(self): """ Get the parent of this element. - + Returns: the parent """ @@ -136,7 +136,7 @@ class Element(object): def set_highlighted(self, highlighted): """ Set the highlight status. - + Args: highlighted: true to enable highlighting """ @@ -145,7 +145,7 @@ class Element(object): def is_highlighted(self): """ Get the highlight status. - + Returns: true if highlighted """ @@ -153,7 +153,7 @@ class Element(object): def get_coordinate(self): """Get the coordinate. - + Returns: the coordinate tuple (x,y) """ @@ -162,7 +162,7 @@ class Element(object): def move(self, delta_coor): """ Move the element by adding the delta_coor to the current coordinate. - + Args: delta_coor: (delta_x,delta_y) tuple """ @@ -178,7 +178,7 @@ class Element(object): A positive width is to the right of the coordinate. A positive height is above the coordinate. The area is associated with a rotation. - + Args: rel_coor: (x,y) offset from this element's coordinate area: (width,height) tuple @@ -191,7 +191,7 @@ class Element(object): A line is defined by 2 relative coordinates. Lines must be horizontal or vertical. The line is associated with a rotation. - + Args: rel_coor1: relative (x1,y1) tuple rel_coor2: relative (x2,y2) tuple @@ -206,11 +206,11 @@ class Element(object): Both coordinates specified: Is this element within the rectangular region defined by both coordinates? ie: do any area corners or line endpoints fall within the region? - + Args: coor: the selection coordinate, tuple x, y coor_m: an additional selection coordinate. - + Returns: self if one of the areas/lines encompasses coor, else None. """ @@ -247,7 +247,7 @@ class Element(object): def get_rotation(self): """ Get the rotation in degrees. - + Returns: the rotation """ @@ -256,7 +256,7 @@ class Element(object): def set_rotation(self, rotation): """ Set the rotation in degrees. - + Args: rotation: the rotation""" if rotation not in POSSIBLE_ROTATIONS: diff --git a/grc/gui/FileDialogs.py b/grc/gui/FileDialogs.py index e8e859dc60..daea7e450f 100644 --- a/grc/gui/FileDialogs.py +++ b/grc/gui/FileDialogs.py @@ -79,7 +79,7 @@ class FileDialogHelper(gtk.FileChooserDialog): FileDialogHelper contructor. Create a save or open dialog with cancel and ok buttons. Use standard settings: no multiple selection, local files only, and the * filter. - + Args: action: gtk.FILE_CHOOSER_ACTION_OPEN or gtk.FILE_CHOOSER_ACTION_SAVE title: the title of the dialog (string) @@ -96,7 +96,7 @@ class FileDialog(FileDialogHelper): def __init__(self, current_file_path=''): """ FileDialog constructor. - + Args: current_file_path: the current directory or path to the open flow graph """ @@ -119,7 +119,7 @@ class FileDialog(FileDialogHelper): def add_and_set_filter(self, filter): """ Add the gtk file filter to the list of filters and set it as the default file filter. - + Args: filter: a gtk file filter. """ @@ -132,7 +132,7 @@ class FileDialog(FileDialogHelper): If this is a save dialog and the file name is missing the extension, append the file extension. If the file name with the extension already exists, show a overwrite dialog. If this is an open dialog, return a list of filenames. - + Returns: the complete file path """ @@ -172,7 +172,7 @@ class FileDialog(FileDialogHelper): def run(self): """ Get the filename and destroy the dialog. - + Returns: the filename or None if a close/cancel occured. """ diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py index 1103aa1639..2b3d08628a 100644 --- a/grc/gui/FlowGraph.py +++ b/grc/gui/FlowGraph.py @@ -87,7 +87,7 @@ class FlowGraph(Element): def add_new_block(self, key, coor=None): """ Add a block of the given key to this flow graph. - + Args: key: the block key coor: an optional coordinate or None for random @@ -114,7 +114,7 @@ class FlowGraph(Element): def copy_to_clipboard(self): """ Copy the selected blocks and connections into the clipboard. - + Returns: the clipboard """ @@ -142,7 +142,7 @@ class FlowGraph(Element): def paste_from_clipboard(self, clipboard): """ Paste the blocks and connections from the clipboard. - + Args: clipboard: the nested data of blocks, connections """ @@ -192,10 +192,10 @@ class FlowGraph(Element): def type_controller_modify_selected(self, direction): """ Change the registered type controller for the selected signal blocks. - + Args: direction: +1 or -1 - + Returns: true for change """ @@ -204,10 +204,10 @@ class FlowGraph(Element): def port_controller_modify_selected(self, direction): """ Change port controller for the selected signal blocks. - + Args: direction: +1 or -1 - + Returns: true for changed """ @@ -216,10 +216,10 @@ class FlowGraph(Element): def enable_selected(self, enable): """ Enable/disable the selected blocks. - + Args: enable: true to enable - + Returns: true if changed """ @@ -233,7 +233,7 @@ class FlowGraph(Element): def move_selected(self, delta_coordinate): """ Move the element and by the change in coordinates. - + Args: delta_coordinate: the change in coordinates """ @@ -244,10 +244,10 @@ class FlowGraph(Element): def rotate_selected(self, rotation): """ Rotate the selected blocks by multiples of 90 degrees. - + Args: rotation: the rotation in degrees - + Returns: true if changed, otherwise false. """ @@ -274,7 +274,7 @@ class FlowGraph(Element): def remove_selected(self): """ Remove selected elements - + Returns: true if changed. """ @@ -362,11 +362,11 @@ class FlowGraph(Element): Iterate though the elements backwards since top elements are at the end of the list. If an element is selected, place it at the end of the list so that is is drawn last, and hence on top. Update the selected port information. - + Args: coor: the coordinate of the mouse click coor_m: the coordinate for multi select - + Returns: the selected blocks and connections or an empty list """ @@ -401,7 +401,7 @@ class FlowGraph(Element): def get_selected_connections(self): """ Get a group of selected connections. - + Returns: sub set of connections in this flow graph """ @@ -413,7 +413,7 @@ class FlowGraph(Element): def get_selected_blocks(self): """ Get a group of selected blocks. - + Returns: sub set of blocks in this flow graph """ @@ -425,7 +425,7 @@ class FlowGraph(Element): def get_selected_block(self): """ Get the selected block when a block or port is selected. - + Returns: a block or None """ @@ -434,7 +434,7 @@ class FlowGraph(Element): def get_selected_elements(self): """ Get the group of selected elements. - + Returns: sub set of elements in this flow graph """ @@ -443,7 +443,7 @@ class FlowGraph(Element): def get_selected_element(self): """ Get the selected element. - + Returns: a block, port, or connection or None """ diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 12f3b203b0..067131ec96 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -121,7 +121,7 @@ class MainWindow(gtk.Window): Handle the delete event from the main window. Generated by pressing X to close, alt+f4, or right click+close. This method in turns calls the state handler to quit. - + Returns: true """ @@ -133,7 +133,7 @@ class MainWindow(gtk.Window): Handle a page change. When the user clicks on a new tab, reload the flow graph to update the vars window and call handle states (select nothing) to update the buttons. - + Args: notebook: the notebook page: new page @@ -150,7 +150,7 @@ class MainWindow(gtk.Window): def add_report_line(self, line): """ Place line at the end of the text buffer, then scroll its window all the way down. - + Args: line: the new text """ @@ -165,7 +165,7 @@ class MainWindow(gtk.Window): """ Create a new notebook page. Set the tab to be selected. - + Args: file_path: optional file to load into the flow graph show: true if the page should be shown after loading @@ -203,7 +203,7 @@ class MainWindow(gtk.Window): def close_pages(self): """ Close all the pages in this notebook. - + Returns: true if all closed """ @@ -228,7 +228,7 @@ class MainWindow(gtk.Window): Close the current page. If the notebook becomes empty, and ensure is true, call new page upon exit to ensure that at least one page exists. - + Args: ensure: boolean """ @@ -258,7 +258,7 @@ class MainWindow(gtk.Window): Set the title of the main window. Set the titles on the page tabs. Show/hide the reports window. - + Args: title: the window title """ @@ -286,7 +286,7 @@ class MainWindow(gtk.Window): def get_page(self): """ Get the selected page. - + Returns: the selected page """ @@ -295,7 +295,7 @@ class MainWindow(gtk.Window): def get_flow_graph(self): """ Get the selected flow graph. - + Returns: the selected flow graph """ @@ -317,7 +317,7 @@ class MainWindow(gtk.Window): def _set_page(self, page): """ Set the current page. - + Args: page: the page widget """ @@ -327,7 +327,7 @@ class MainWindow(gtk.Window): def _save_changes(self): """ Save changes to flow graph? - + Returns: true if yes """ @@ -339,7 +339,7 @@ class MainWindow(gtk.Window): def _get_files(self): """ Get the file names for all the pages, in order. - + Returns: list of file paths """ @@ -348,7 +348,7 @@ class MainWindow(gtk.Window): def _get_pages(self): """ Get a list of all pages in the notebook. - + Returns: list of pages """ diff --git a/grc/gui/Messages.py b/grc/gui/Messages.py index 2bf488bb58..3fa78f85d4 100644 --- a/grc/gui/Messages.py +++ b/grc/gui/Messages.py @@ -26,7 +26,7 @@ MESSENGERS_LIST = list() def register_messenger(messenger): """ Append the given messenger to the list of messengers. - + Args: messenger: a method thats takes a string """ @@ -35,7 +35,7 @@ def register_messenger(messenger): def send(message): """ Give the message to each of the messengers. - + Args: message: a message string """ diff --git a/grc/gui/NotebookPage.py b/grc/gui/NotebookPage.py index 10c5dde00d..481aca4eea 100644 --- a/grc/gui/NotebookPage.py +++ b/grc/gui/NotebookPage.py @@ -36,7 +36,7 @@ class NotebookPage(gtk.HBox): def __init__(self, main_window, flow_graph, file_path=''): """ Page constructor. - + Args: main_window: main window file_path: path to a flow graph file @@ -91,7 +91,7 @@ class NotebookPage(gtk.HBox): def get_generator(self): """ Get the generator object for this flow graph. - + Returns: generator """ @@ -104,7 +104,7 @@ class NotebookPage(gtk.HBox): """ The button was clicked. Make the current page selected, then close. - + Args: the: button """ @@ -114,7 +114,7 @@ class NotebookPage(gtk.HBox): def set_markup(self, markup): """ Set the markup in this label. - + Args: markup: the new markup text """ @@ -123,7 +123,7 @@ class NotebookPage(gtk.HBox): def get_tab(self): """ Get the gtk widget for this page's tab. - + Returns: gtk widget """ @@ -132,7 +132,7 @@ class NotebookPage(gtk.HBox): def get_proc(self): """ Get the subprocess for the flow graph. - + Returns: the subprocess object """ @@ -141,7 +141,7 @@ class NotebookPage(gtk.HBox): def set_proc(self, process): """ Set the subprocess object. - + Args: process: the new subprocess """ @@ -150,7 +150,7 @@ class NotebookPage(gtk.HBox): def get_flow_graph(self): """ Get the flow graph. - + Returns: the flow graph """ @@ -160,7 +160,7 @@ class NotebookPage(gtk.HBox): """ Get the read-only state of the file. Always false for empty path. - + Returns: true for read-only """ @@ -171,7 +171,7 @@ class NotebookPage(gtk.HBox): def get_file_path(self): """ Get the file path for the flow graph. - + Returns: the file path or '' """ @@ -180,7 +180,7 @@ class NotebookPage(gtk.HBox): def set_file_path(self, file_path=''): """ Set the file path, '' for no file path. - + Args: file_path: file path string """ @@ -190,7 +190,7 @@ class NotebookPage(gtk.HBox): def get_saved(self): """ Get the saved status for the flow graph. - + Returns: true if saved """ @@ -199,7 +199,7 @@ class NotebookPage(gtk.HBox): def set_saved(self, saved=True): """ Set the saved status. - + Args: saved: boolean status """ @@ -208,7 +208,7 @@ class NotebookPage(gtk.HBox): def get_state_cache(self): """ Get the state cache for the flow graph. - + Returns: the state cache """ diff --git a/grc/gui/Param.py b/grc/gui/Param.py index 2ca20fab2a..499af2e2ed 100644 --- a/grc/gui/Param.py +++ b/grc/gui/Param.py @@ -227,7 +227,7 @@ class Param(Element): An enum requires and combo parameter. A non-enum with options gets a combined entry/combo parameter. All others get a standard entry parameter. - + Returns: gtk input class """ @@ -245,7 +245,7 @@ class Param(Element): def get_markup(self): """ Get the markup for this param. - + Returns: a pango markup string """ diff --git a/grc/gui/Port.py b/grc/gui/Port.py index e542797ea6..8b4edfa430 100644 --- a/grc/gui/Port.py +++ b/grc/gui/Port.py @@ -88,7 +88,7 @@ class Port(Element): self._connector_length = CONNECTOR_EXTENSION_MINIMAL + CONNECTOR_EXTENSION_INCREMENT*index def modify_height(self, start_height): type_dict = {'bus':(lambda a: a * 3)}; - + if self.get_type() in type_dict: return type_dict[self.get_type()](start_height); else: @@ -119,7 +119,7 @@ class Port(Element): def draw(self, gc, window): """ Draw the socket with a label. - + Args: gc: the graphics context window: the gtk window to draw on @@ -139,7 +139,7 @@ class Port(Element): def get_connector_coordinate(self): """ Get the coordinate where connections may attach to. - + Returns: the connector coordinate (x, y) tuple """ @@ -152,7 +152,7 @@ class Port(Element): Get the direction that the socket points: 0,90,180,270. This is the rotation degree if the socket is an output or the rotation degree + 180 if the socket is an input. - + Returns: the direction in degrees """ @@ -163,7 +163,7 @@ class Port(Element): """ Get the length of the connector. The connector length increases as the port index changes. - + Returns: the length in pixels """ @@ -172,7 +172,7 @@ class Port(Element): def get_rotation(self): """ Get the parent's rotation rather than self. - + Returns: the parent's rotation """ @@ -181,7 +181,7 @@ class Port(Element): def move(self, delta_coor): """ Move the parent rather than self. - + Args: delta_corr: the (delta_x, delta_y) tuple """ @@ -190,7 +190,7 @@ class Port(Element): def rotate(self, direction): """ Rotate the parent rather than self. - + Args: direction: degrees to rotate """ @@ -199,7 +199,7 @@ class Port(Element): def get_coordinate(self): """ Get the parent's coordinate rather than self. - + Returns: the parents coordinate """ @@ -208,7 +208,7 @@ class Port(Element): def set_highlighted(self, highlight): """ Set the parent highlight rather than self. - + Args: highlight: true to enable highlighting """ @@ -217,7 +217,7 @@ class Port(Element): def is_highlighted(self): """ Get the parent's is highlight rather than self. - + Returns: the parent's highlighting status """ diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py index 05e997b3e3..d7ba8c51c9 100644 --- a/grc/gui/PropsDialog.py +++ b/grc/gui/PropsDialog.py @@ -34,10 +34,10 @@ def get_title_label(title): """ Get a title label for the params window. The title will be bold, underlined, and left justified. - + Args: title: the text of the title - + Returns: a gtk object """ @@ -56,7 +56,7 @@ class PropsDialog(gtk.Dialog): def __init__(self, block): """ Properties dialog constructor. - + Args: block: a block instance """ @@ -118,7 +118,7 @@ class PropsDialog(gtk.Dialog): To the props dialog, the hide setting of 'none' and 'part' are identical. Therefore, the props dialog only cares if the hide setting is/not 'all'. Make a hash that uniquely represents the params' state. - + Returns: true if changed """ @@ -179,7 +179,7 @@ class PropsDialog(gtk.Dialog): """ Handle key presses from the keyboard. Call the ok response when enter is pressed. - + Returns: false to forward the keypress """ @@ -191,7 +191,7 @@ class PropsDialog(gtk.Dialog): def run(self): """ Run the dialog and get its response. - + Returns: true if the response was accept """ diff --git a/grc/gui/StateCache.py b/grc/gui/StateCache.py index 558f507716..3cdb5f30ce 100644 --- a/grc/gui/StateCache.py +++ b/grc/gui/StateCache.py @@ -30,7 +30,7 @@ class StateCache(object): def __init__(self, initial_state): """ StateCache constructor. - + Args: initial_state: the intial state (nested data) """ @@ -45,7 +45,7 @@ class StateCache(object): """ Save a new state. Place the new state at the next index and add one to the number of previous states. - + Args: state: the new state """ @@ -59,7 +59,7 @@ class StateCache(object): def get_current_state(self): """ Get the state at the current index. - + Returns: the current state (nested data) """ @@ -69,7 +69,7 @@ class StateCache(object): def get_prev_state(self): """ Get the previous state and decrement the current index. - + Returns: the previous state or None """ @@ -83,7 +83,7 @@ class StateCache(object): def get_next_state(self): """ Get the nest state and increment the current index. - + Returns: the next state or None """ diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py index cc1f8ceb12..ebd5aefca7 100644 --- a/grc/gui/Utils.py +++ b/grc/gui/Utils.py @@ -29,7 +29,7 @@ def rotate_pixmap(gc, src_pixmap, dst_pixmap, angle=gtk.gdk.PIXBUF_ROTATE_COUNTE Load the destination pixmap with a rotated version of the source pixmap. The source pixmap will be loaded into a pixbuf, rotated, and drawn to the destination pixmap. The pixbuf is a client-side drawable, where a pixmap is a server-side drawable. - + Args: gc: the graphics context src_pixmap: the source pixmap @@ -49,11 +49,11 @@ def rotate_pixmap(gc, src_pixmap, dst_pixmap, angle=gtk.gdk.PIXBUF_ROTATE_COUNTE def get_rotated_coordinate(coor, rotation): """ Rotate the coordinate by the given rotation. - + Args: coor: the coordinate x, y tuple rotation: the angle in degrees - + Returns: the rotated coordinates """ @@ -74,11 +74,11 @@ def get_rotated_coordinate(coor, rotation): def get_angle_from_coordinates((x1,y1), (x2,y2)): """ Given two points, calculate the vector direction from point1 to point2, directions are multiples of 90 degrees. - + Args: (x1,y1): the coordinate of point 1 (x2,y2): the coordinate of point 2 - + Returns: the direction in degrees """ @@ -93,10 +93,10 @@ def parse_template(tmpl_str, **kwargs): """ Parse the template string with the given args. Pass in the xml encode method for pango escape chars. - + Args: tmpl_str: the template as a string - + Returns: a string of the parsed template """ |