commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11189 - in gnuradio/branches/developers/jblum/grc/grc


From: jblum
Subject: [Commit-gnuradio] r11189 - in gnuradio/branches/developers/jblum/grc/grc: . base blocks gui python scripts
Date: Sat, 13 Jun 2009 20:08:26 -0600 (MDT)

Author: jblum
Date: 2009-06-13 20:08:26 -0600 (Sat, 13 Jun 2009)
New Revision: 11189

Added:
   gnuradio/branches/developers/jblum/grc/grc/__init__.py.in
   gnuradio/branches/developers/jblum/grc/grc/base/Constants.py
   gnuradio/branches/developers/jblum/grc/grc/grc.conf.in
   gnuradio/branches/developers/jblum/grc/grc/python/Constants.py
Removed:
   gnuradio/branches/developers/jblum/grc/grc/__init__.py
   gnuradio/branches/developers/jblum/grc/grc/base/Constants.py.in
   gnuradio/branches/developers/jblum/grc/grc/python/Constants.py.in
Modified:
   gnuradio/branches/developers/jblum/grc/grc/
   gnuradio/branches/developers/jblum/grc/grc/Makefile.am
   gnuradio/branches/developers/jblum/grc/grc/Makefile.inc
   gnuradio/branches/developers/jblum/grc/grc/base/Makefile.am
   gnuradio/branches/developers/jblum/grc/grc/blocks/Makefile.am
   gnuradio/branches/developers/jblum/grc/grc/gui/Dialogs.py
   gnuradio/branches/developers/jblum/grc/grc/gui/Messages.py
   gnuradio/branches/developers/jblum/grc/grc/python/Makefile.am
   gnuradio/branches/developers/jblum/grc/grc/python/Platform.py
   gnuradio/branches/developers/jblum/grc/grc/python/extract_docs.py
   gnuradio/branches/developers/jblum/grc/grc/scripts/grc
   gnuradio/branches/developers/jblum/grc/grc/scripts/usrp2_probe
   gnuradio/branches/developers/jblum/grc/grc/scripts/usrp_probe
Log:
Make blocks dir/path, docs dir, and pythonw all configurable via config file or 
environment variable.


Property changes on: gnuradio/branches/developers/jblum/grc/grc
___________________________________________________________________
Modified: svn:ignore
   - Makefile
Makefile.in

   + grc.conf
__init__.py
Makefile
Makefile.in


Modified: gnuradio/branches/developers/jblum/grc/grc/Makefile.am
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/Makefile.am      2009-06-14 
01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/Makefile.am      2009-06-14 
02:08:26 UTC (rev 11189)
@@ -31,11 +31,36 @@
        python \
        scripts
 
-ourpythondir = $(grc_src_prefix)
-ourpython_PYTHON = __init__.py
-
 ## append freedesktop to the list of subdirs when xdg utils are present
 if XDG_UTILS
 SUBDIRS += freedesktop
 endif
+
+ourpythondir = $(grc_src_prefix)
+ourpython_PYTHON = __init__.py
+
+etcdir = $(gr_sysconfdir)
+dist_etc_DATA = grc.conf
+
+EXTRA_DIST = \
+       $(srcdir)/__init__.py.in \
+       $(srcdir)/grc.conf.in
+
+BUILT_SOURCES = \
+       __init__.py \
+       grc.conf
+
+__init__.py: $(srcdir)/__init__.py.in Makefile
+       sed \
+               -e 's|@address@hidden|$(PACKAGE)|g' \
+               -e 's|@address@hidden|$(VERSION)|g' \
+       $< > $@
+
+grc.conf: $(srcdir)/grc.conf.in Makefile
+       sed \
+               -e 's|@address@hidden|$(PYTHONW)|g' \
+               -e 's|@address@hidden|$(grc_blocksdir)|g' \
+               -e 's|@address@hidden|$(gr_docdir)|g' \
+       $< > $@
+
 endif

Modified: gnuradio/branches/developers/jblum/grc/grc/Makefile.inc
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/Makefile.inc     2009-06-14 
01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/Makefile.inc     2009-06-14 
02:08:26 UTC (rev 11189)
@@ -21,6 +21,4 @@
 
 include $(top_srcdir)/Makefile.common
 grc_src_prefix = $(pythondir)/gnuradio/grc
-grc_base_data_reldir = grc/base
-grc_python_data_reldir = grc/python
-grc_blocks_data_reldir = grc/blocks
+grc_blocksdir = $(pkgdatadir)/grc/blocks

Copied: gnuradio/branches/developers/jblum/grc/grc/__init__.py.in (from rev 
11188, gnuradio/branches/developers/jblum/grc/grc/__init__.py)
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/__init__.py.in                   
        (rev 0)
+++ gnuradio/branches/developers/jblum/grc/grc/__init__.py.in   2009-06-14 
02:08:26 UTC (rev 11189)
@@ -0,0 +1,22 @@
+"""
+Copyright 2009 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+GNU Radio Companion is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+"""
+
+#package and version constants
+PACKAGE = '@PACKAGE@'
+VERSION = '@VERSION@'

Copied: gnuradio/branches/developers/jblum/grc/grc/base/Constants.py (from rev 
11188, gnuradio/branches/developers/jblum/grc/grc/base/Constants.py.in)
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/base/Constants.py                
                (rev 0)
+++ gnuradio/branches/developers/jblum/grc/grc/base/Constants.py        
2009-06-14 02:08:26 UTC (rev 11189)
@@ -0,0 +1,25 @@
+"""
+Copyright 2008, 2009 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+GNU Radio Companion is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+"""
+
+import os
+
+#data files
+DATA_DIR = os.path.dirname(__file__)
+FLOW_GRAPH_DTD = os.path.join(DATA_DIR, 'flow_graph.dtd')
+BLOCK_TREE_DTD = os.path.join(DATA_DIR, 'block_tree.dtd')

Modified: gnuradio/branches/developers/jblum/grc/grc/base/Makefile.am
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/base/Makefile.am 2009-06-14 
01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/base/Makefile.am 2009-06-14 
02:08:26 UTC (rev 11189)
@@ -35,17 +35,6 @@
        Port.py \
        __init__.py
 
-Constants.py: $(srcdir)/Constants.py.in Makefile
-       sed \
-               -e 's|@address@hidden|$(PACKAGE)|g' \
-               -e 's|@address@hidden|$(VERSION)|g' \
-               -e 's|@address@hidden|$(pkgdatadir)|g' \
-               -e 's|@address@hidden|$(grc_base_data_reldir)|g' \
-       $< > $@
-
-EXTRA_DIST = $(srcdir)/Constants.py.in
-BUILT_SOURCES = Constants.py
-
 ourdatadir = $(grc_src_prefix)/base
 dist_ourdata_DATA = \
        block_tree.dtd \

Modified: gnuradio/branches/developers/jblum/grc/grc/blocks/Makefile.am
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/blocks/Makefile.am       
2009-06-14 01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/blocks/Makefile.am       
2009-06-14 02:08:26 UTC (rev 11189)
@@ -21,8 +21,7 @@
 
 include $(top_srcdir)/grc/Makefile.inc
 
-ourdatadir = $(pkgdatadir)/$(grc_blocks_data_reldir)
-
+ourdatadir = $(grc_blocksdir)
 dist_ourdata_DATA = \
        audio_sink.xml \
        audio_source.xml \

Added: gnuradio/branches/developers/jblum/grc/grc/grc.conf.in
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/grc.conf.in                      
        (rev 0)
+++ gnuradio/branches/developers/jblum/grc/grc/grc.conf.in      2009-06-14 
02:08:26 UTC (rev 11189)
@@ -0,0 +1,9 @@
+# This file contains system wide configuration data for GNU Radio.
+# You may override any setting on a per-user basis by editing
+# ~/.gnuradio/config.conf
+
+[grc]
+pythonw = @pythonw@
+doc_dir = @docdir@
+global_blocks_path = @blocksdir@
+local_blocks_path =


Property changes on: gnuradio/branches/developers/jblum/grc/grc/grc.conf.in
___________________________________________________________________
Added: svn:mergeinfo
   + 

Modified: gnuradio/branches/developers/jblum/grc/grc/gui/Dialogs.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/gui/Dialogs.py   2009-06-14 
01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/gui/Dialogs.py   2009-06-14 
02:08:26 UTC (rev 11189)
@@ -20,7 +20,7 @@
 import pygtk
 pygtk.require('2.0')
 import gtk
-from .. base.Constants import PACKAGE, VERSION
+from .. import PACKAGE, VERSION
 import Preferences
 
 class TextDisplay(gtk.TextView):

Modified: gnuradio/branches/developers/jblum/grc/grc/gui/Messages.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/gui/Messages.py  2009-06-14 
01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/gui/Messages.py  2009-06-14 
02:08:26 UTC (rev 11189)
@@ -17,7 +17,7 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
-from .. base.Constants import PACKAGE, VERSION
+from .. import PACKAGE, VERSION
 import traceback
 import sys
 

Copied: gnuradio/branches/developers/jblum/grc/grc/python/Constants.py (from 
rev 11188, gnuradio/branches/developers/jblum/grc/grc/python/Constants.py.in)
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/Constants.py              
                (rev 0)
+++ gnuradio/branches/developers/jblum/grc/grc/python/Constants.py      
2009-06-14 02:08:26 UTC (rev 11189)
@@ -0,0 +1,63 @@
+"""
+Copyright 2008 Free Software Foundation, Inc.
+This file is part of GNU Radio
+
+GNU Radio Companion is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+GNU Radio Companion is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+"""
+
+import os
+import sys
+import stat
+from gnuradio import gr
+
+_gr_prefs = gr.prefs()
+
+PYEXEC = os.environ.get('PYTHONW', _gr_prefs.get_string('grc', 'pythonw', ''))
+
+#setup paths
+PATH_SEP = ':'
+DOCS_DIR = os.environ.get('GR_DOC_DIR', _gr_prefs.get_string('grc', 'doc_dir', 
''))
+HIER_BLOCKS_LIB_DIR = os.path.join(os.path.expanduser('~'), '.grc_gnuradio')
+BLOCKS_DIRS = filter( #filter blank strings
+       lambda x: x, PATH_SEP.join([
+               os.environ.get('GRC_BLOCKS_PATH', ''),
+               _gr_prefs.get_string('grc', 'local_blocks_path', ''),
+               _gr_prefs.get_string('grc', 'global_blocks_path', ''),
+       ]).split(PATH_SEP),
+) + [HIER_BLOCKS_LIB_DIR]
+
+#file creation modes
+TOP_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | 
stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH
+HIER_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | 
stat.S_IWGRP | stat.S_IROTH
+
+#data files
+DATA_DIR = os.path.dirname(__file__)
+FLOW_GRAPH_TEMPLATE = os.path.join(DATA_DIR, 'flow_graph.tmpl')
+BLOCK_DTD = os.path.join(DATA_DIR, 'block.dtd')
+BLOCK_TREE = os.path.join(DATA_DIR, 'block_tree.xml')
+DEFAULT_FLOW_GRAPH = os.path.join(DATA_DIR, 'default_flow_graph.grc')
+
+#coloring
+COMPLEX_COLOR_SPEC = '#3399FF'
+FLOAT_COLOR_SPEC = '#FF8C69'
+INT_COLOR_SPEC = '#00FF99'
+SHORT_COLOR_SPEC = '#FFFF66'
+BYTE_COLOR_SPEC = '#FF66FF'
+COMPLEX_VECTOR_COLOR_SPEC = '#3399AA'
+FLOAT_VECTOR_COLOR_SPEC = '#CC8C69'
+INT_VECTOR_COLOR_SPEC = '#00CC99'
+SHORT_VECTOR_COLOR_SPEC = '#CCCC33'
+BYTE_VECTOR_COLOR_SPEC = '#CC66CC'
+ID_COLOR_SPEC = '#DDDDDD'

Modified: gnuradio/branches/developers/jblum/grc/grc/python/Makefile.am
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/Makefile.am       
2009-06-14 01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/python/Makefile.am       
2009-06-14 02:08:26 UTC (rev 11189)
@@ -36,17 +36,6 @@
        Port.py \
        __init__.py
 
-Constants.py: $(srcdir)/Constants.py.in Makefile
-       sed \
-               -e 's|@address@hidden|$(PYTHONW)|g' \
-               -e 's|@address@hidden|$(grc_python_data_reldir)|g' \
-               -e 's|@address@hidden|$(grc_blocks_data_reldir)|g' \
-               -e 's|@address@hidden|$(gr_docdir)|g' \
-       $< > $@
-
-EXTRA_DIST = $(srcdir)/Constants.py.in
-BUILT_SOURCES = Constants.py
-
 ourdatadir = $(grc_src_prefix)/python
 dist_ourdata_DATA = \
        block.dtd \

Modified: gnuradio/branches/developers/jblum/grc/grc/python/Platform.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/Platform.py       
2009-06-14 01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/python/Platform.py       
2009-06-14 02:08:26 UTC (rev 11189)
@@ -28,13 +28,11 @@
 from Constants import \
        HIER_BLOCKS_LIB_DIR, BLOCK_DTD, \
        BLOCK_TREE, DEFAULT_FLOW_GRAPH, \
-       BLOCKS_DIR
+       BLOCKS_DIRS
 
-_critical_blocks_only = map(lambda b: os.path.join(BLOCKS_DIR, b), 
['options.xml', 'usrp_probe.xml', 'usrp2_probe.xml'])
-
 class Platform(_Platform):
 
-       def __init__(self, extra_blocks=[], critical_only=False):
+       def __init__(self, extra_blocks=[]):
                """
                Make a platform for gnuradio.
                @param extra_blocks a list of block paths to load in addition 
to main block library
@@ -42,8 +40,7 @@
                """
                #ensure hier dir
                if not os.path.exists(HIER_BLOCKS_LIB_DIR): 
os.mkdir(HIER_BLOCKS_LIB_DIR)
-               if critical_only: block_paths = _critical_blocks_only
-               else: block_paths = extra_blocks + [HIER_BLOCKS_LIB_DIR, 
BLOCKS_DIR]
+               block_paths = extra_blocks + BLOCKS_DIRS
                #convert block paths to absolute paths, ensure uniqueness
                block_paths = set(map(os.path.abspath, block_paths))
                #init

Modified: gnuradio/branches/developers/jblum/grc/grc/python/extract_docs.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/python/extract_docs.py   
2009-06-14 01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/python/extract_docs.py   
2009-06-14 02:08:26 UTC (rev 11189)
@@ -48,10 +48,8 @@
        @param key the block key
        @return a string with documentation
        """
-       UBUNTU_DOCS_DIR = '/usr/share/doc/gnuradio-doc/xml'
-       if os.path.exists(DOCS_DIR): docs_dir = DOCS_DIR
-       elif os.path.exists(UBUNTU_DOCS_DIR): docs_dir = UBUNTU_DOCS_DIR
-       else: return ''
+       docs_dir = os.path.join(DOCS_DIR, 'xml')
+       if not os.path.exists(docs_dir): return ''
        #extract matches
        pattern = key.replace('_', '_*').replace('x', '\w')
        prog = re.compile('^class%s\..*$'%pattern)

Modified: gnuradio/branches/developers/jblum/grc/grc/scripts/grc
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/scripts/grc      2009-06-14 
01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/scripts/grc      2009-06-14 
02:08:26 UTC (rev 11189)
@@ -18,8 +18,6 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
-import os
-
 import pygtk
 pygtk.require('2.0')
 import gtk
@@ -32,7 +30,7 @@
        d.run()
        exit(-1)
 
-from gnuradio.grc.base.Constants import VERSION
+from gnuradio.grc import VERSION
 from optparse import OptionParser
 
 if __name__ == "__main__":
@@ -52,8 +50,5 @@
        #setup icon using icon theme
        try: 
gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
        except: pass
-       #extract extra block paths from environment variable, separated by 
semicolon
-       try: extra_blocks = os.environ['GRC_BLOCKS_PATH'].split(';')
-       except: extra_blocks = list()
-       ActionHandler(args, Platform(extra_blocks=extra_blocks))
+       ActionHandler(args, Platform())
 

Modified: gnuradio/branches/developers/jblum/grc/grc/scripts/usrp2_probe
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/scripts/usrp2_probe      
2009-06-14 01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/scripts/usrp2_probe      
2009-06-14 02:08:26 UTC (rev 11189)
@@ -30,7 +30,7 @@
 from gnuradio.grc.gui.Dialogs import TextDisplay
 
 from gnuradio.grc.python.Platform import Platform
-platform = Platform(critical_only=True)
+platform = Platform()
 
 from gnuradio.grc.gui.Platform import Platform
 platform = Platform(platform)

Modified: gnuradio/branches/developers/jblum/grc/grc/scripts/usrp_probe
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/scripts/usrp_probe       
2009-06-14 01:15:08 UTC (rev 11188)
+++ gnuradio/branches/developers/jblum/grc/grc/scripts/usrp_probe       
2009-06-14 02:08:26 UTC (rev 11189)
@@ -28,7 +28,7 @@
 from gnuradio.grc.gui.Dialogs import TextDisplay
 
 from gnuradio.grc.python.Platform import Platform
-platform = Platform(critical_only=True)
+platform = Platform()
 
 from gnuradio.grc.gui.Platform import Platform
 platform = Platform(platform)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]