[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/25: grc: minor fixes/clean-ups
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/25: grc: minor fixes/clean-ups |
Date: |
Fri, 27 May 2016 19:14:58 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit d535ba24c44247630555d95efc9bde1696d555a4
Author: Sebastian Koslowski <address@hidden>
Date: Sat May 7 13:26:01 2016 +0200
grc: minor fixes/clean-ups
---
grc/core/Block.py | 2 +-
grc/gui/Actions.py | 4 +++-
grc/gui/Utils.py | 9 +++++----
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/grc/core/Block.py b/grc/core/Block.py
index 106e4bc..c2111fe 100644
--- a/grc/core/Block.py
+++ b/grc/core/Block.py
@@ -356,7 +356,7 @@ class Block(Element):
"""
Resolve all import statements.
Split each import statement at newlines.
- Combine all import statments into a list.
+ Combine all import statements into a list.
Filter empty imports.
Returns:
diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py
index 484d4f3..ce5bc4e 100644
--- a/grc/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -92,6 +92,7 @@ class _ActionBase(object):
self.set_accel_group(get_accel_group())
self.set_accel_path(accel_path)
gtk.accel_map_add_entry(accel_path, keyval, mod_mask)
+ self.args = None
def __str__(self):
"""
@@ -105,10 +106,11 @@ class _ActionBase(object):
def __repr__(self): return str(self)
- def __call__(self):
+ def __call__(self, *args):
"""
Emit the activate signal when called with ().
"""
+ self.args = args
self.emit('activate')
diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py
index f20e3c0..51b9b19 100644
--- a/grc/gui/Utils.py
+++ b/grc/gui/Utils.py
@@ -123,10 +123,11 @@ class TemplateParser(object):
parse_template = TemplateParser()
-def align_to_grid(coor):
- _align = lambda: int(round(x / (1.0 * CANVAS_GRID_SIZE)) *
CANVAS_GRID_SIZE)
+def align_to_grid(coor, mode=round):
+ def align(value):
+ return int(mode(value / (1.0 * CANVAS_GRID_SIZE)) * CANVAS_GRID_SIZE)
try:
- return [_align() for x in coor]
+ return map(align, coor)
except TypeError:
x = coor
- return _align()
+ return align(coor)
- [Commit-gnuradio] [gnuradio] 15/25: grc: fix flow graph execution (amends ActionHandler refactoring), (continued)
- [Commit-gnuradio] [gnuradio] 15/25: grc: fix flow graph execution (amends ActionHandler refactoring), git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 10/25: grc: Variable editor tweaks., git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 25/25: Merge remote-tracking branch 'dkozel/uhd_lo_api', git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 16/25: Added controls for importing, exporting, and sharing LOs, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 17/25: grc-refactor: fix custom canvas font sizes, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 08/25: grc: Added the variable editor panel, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 09/25: grc: Added context menu to variable editor, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 06/25: grc: remove some dead code in FlowGraph.what_is_selected(), git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 23/25: Merge remote-tracking branch 'mbr0wn/modtool/versioning', git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 02/25: grc: block alignment tools, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 03/25: grc: minor fixes/clean-ups,
git <=
- [Commit-gnuradio] [gnuradio] 05/25: grc: some action handler refactoring, add flow_graph.update() wrapper, git, 2016/05/27