Hi, In creating Debian packages for gnuradio I ran across a policy issue - no language extensions in /usr/bin...
"When scripts are installed into a directory in the system PATH, the script name should not include an extension such as .sh or .pl that denotes the scripting language currently used to implement it." -- http://www.debian.org/doc/debian-policy/ch-files.html#s-scripts The lintian program elaborates and says: "The implementation language may change; if it does, leaving the name the same would be confusing and changing it would be disruptive." So in my current packaging efforts I just rename all the .py files in /usr/bin just before building the package. That works just fine for most of them. However, gr_plot_fft_c and gr_plot_fft_f include gr_plot_fft, and gr_plot_psd_c and gr_plot_psd_f include gr_plot_psd. Python expects the gr_plot_fft.py and gr_plot_psd.py files to be findable. So, I suggest that gr_plot_fft.py and gr_plot_psd.py files be made part of the gnuradio python package. Then gr_plot_fft_c and gr_plot_fft_f do a 'from gnuradio.gr_plot_fft include gr_plot_fft' and gr_plot_psd_c and gr_plot_psd_f do a 'from gnuradio.gr_plot_psd import gr_plot_psd'. The attached patch handles this. At this time I move files around after the CMake install gets run. I'd like to propose the following changes: - install gr_plot_fft.py and gr_plot_psd.py in the gnuradio python package directory right beside plot_data.py, promoting these files to gnuradio module status. - patch gr_plot_fft_c, gr_plot_fft_f gr_plot_psd_c and gr_plot_psd_f to include gnuradio.gr_plot_XXX as appropriate. (patch attached) - Remove the .py extension on any script installed in GR_RUNTIME_DIR. One benefit of doing this is that the man page mechanisms for user commands work best without the .py extensions in the way. (And having man pages is important in Debian policy as well.) While my patch does not include changes in the build system to get files installed correctly, and does not track down any documentation advising users to run the scripts with the .py extension, I hope this suggestion is adopted. Let me know if I need to handle these loose ends with an updated patch, or if that task is more quickly and easily done by another gnuradio coder. Thanks, -Maitland enc: plot-fft-psd-modules patch
--- a/gr-utils/src/python/gr_plot_fft_c.py +++ b/gr-utils/src/python/gr_plot_fft_c.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -import gr_plot_fft +from gnuradio.gr_plot_fft import gr_plot_fft def main(): parser = gr_plot_fft.setup_options() --- a/gr-utils/src/python/gr_plot_fft_f.py +++ b/gr-utils/src/python/gr_plot_fft_f.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -import gr_plot_fft +from gnuradio.gr_plot_fft import gr_plot_fft def main(): parser = gr_plot_fft.setup_options() --- a/gr-utils/src/python/gr_plot_psd_c.py +++ b/gr-utils/src/python/gr_plot_psd_c.py @@ -21,7 +21,7 @@ # from optparse import OptionParser -import gr_plot_psd +from gnuradio.gr_plot_psd import gr_plot_psd # This is a wrapper program for gr_plot_psd specifically for complex data --- a/gr-utils/src/python/gr_plot_psd_f.py +++ b/gr-utils/src/python/gr_plot_psd_f.py @@ -21,7 +21,7 @@ # from optparse import OptionParser -import gr_plot_psd +from gnuradio.gr_plot_psd import gr_plot_psd # This is a wrapper program for gr_plot_psd specifically for floating point data
_______________________________________________ Patch-gnuradio mailing list Patch-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/patch-gnuradio