grc: don't blacklist default fg id

Signed-off-by: Josh Morman <jmorman@gnuradio.org>
This commit is contained in:
Josh Morman 2021-12-27 13:16:21 -05:00 committed by mormj
parent f28db3236d
commit d61a0258aa
3 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ DATA_DIR = os.path.dirname(__file__)
BLOCK_DTD = os.path.join(DATA_DIR, 'block.dtd')
DEFAULT_FLOW_GRAPH = os.path.join(DATA_DIR, 'default_flow_graph.grc')
DEFAULT_HIER_BLOCK_LIB_DIR = os.path.expanduser('~/.grc_gnuradio')
DEFAULT_FLOW_GRAPH_ID = 'default'
CACHE_FILE = os.path.expanduser('~/.cache/grc_gnuradio/cache_v2.json')

View File

@ -13,7 +13,7 @@ from .. import Constants
# Blacklist certain ids, its not complete, but should help
ID_BLACKLIST = ['self', 'default'] + dir(builtins)
ID_BLACKLIST = ['self'] + dir(builtins)
try:
from gnuradio import gr
ID_BLACKLIST.extend(attr for attr in dir(

View File

@ -660,7 +660,7 @@ class Application(Gtk.Application):
file_path = FileDialogs.SaveFlowGraph(main, page.file_path).run()
if file_path is not None:
if flow_graph.options_block.params['id'].get_value() == 'default':
if flow_graph.options_block.params['id'].get_value() == Constants.DEFAULT_FLOW_GRAPH_ID:
file_name = os.path.basename(file_path).replace(".grc", "")
flow_graph.options_block.params['id'].set_value(file_name)
flow_graph_update(flow_graph)