I was able to get this working by simply catching an exception when
attempting to import Colors.  This seems to be the source of the problem
and you don't really need that module when running grcc.  See attached
patch.

-Roy


On Tue, Jun 18, 2013 at 4:09 PM, Dan CaJacob <dan.caja...@gmail.com> wrote:

> Josh and Tom,
>
> I'll try to go back and look into where I left it.  I had taken your
> advice and basically changed all the relevant classes to not inherit the
> GUI stuff, but I still ended up with an untenable error in the end, that
> now that you mention it, I think was related to Param.py...  As I recall,
> the weird thing was that the error did not match up with the source file it
> was referencing.
>
> Sorry, I know this is super vague.  So, I'll just dig back into it and
> come back with more specifics.
>
> Thanks!
>
> Very Respectfully,
>
> Dan CaJacob
>
>
> On Tue, Jun 18, 2013 at 3:30 PM, Josh Blum <j...@joshknows.com> wrote:
>
>>
>> >
>> > Following up on a comment Josh made in the earlier discussion about
>> GRCC, I
>> > tried to pull out all of the GUI references that the GRCC tool depends
>> on,
>> > but I still ended up with an enigmatic error in the end.  Unfortunately,
>> > this was done two weeks ago and I don't have any good info on where I
>> left
>> > it.
>> >
>> >
>>
>> I think I had mentioned that GRCC could import the non-gui stuff, from
>> the grc/python directory, and that would avoid the import gtk statement,
>> which is messing up the ability to do non gui stuff.
>>
>> So looking into grc/python
>> > ~/src/gnuradio/grc/python$ grep gtk *
>> > flow_graph.tmpl:        #import gtk
>> > flow_graph.tmpl:        #set $icon =
>> gtk.IconTheme().lookup_icon('gnuradio-grc', 32, 0)
>> > Param.py:import pygtk
>> > Param.py:pygtk.require('2.0')
>> > Param.py:import gtk
>> > Param.py:               input = gtk.Button('...')
>> > Param.py:                       file_dialog =
>> gtk.FileChooserDialog('Open a Data File...', None,
>> > Param.py:                               gtk.FILE_CHOOSER_ACTION_OPEN,
>> ('gtk-cancel',gtk.RESPONSE_CANCEL,'gtk-open',gtk.RESPONSE_OK))
>> > Param.py:                       file_dialog =
>> gtk.FileChooserDialog('Save a Data File...', None,
>> > Param.py:                               gtk.FILE_CHOOSER_ACTION_SAVE,
>> ('gtk-cancel',gtk.RESPONSE_CANCEL, 'gtk-save',gtk.RESPONSE_OK))
>> > Param.py:               if gtk.RESPONSE_OK == file_dialog.run(): #run
>> the dialog
>>
>> It looks like only the Param.py would cause a runtime import issue with
>> gtk/pygtk. In this case, that imprt statement could be moved to the
>> indentation level where it is used (file dialog).
>>
>> Did you notice other modules pulling gtk imports that should not have?
>> Or were you unable to rewrite the GRCC to completely avoid importing
>> modules from grc/gui?
>>
>> -josh
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>

Attachment: 0001-Updates-to-allow-grcc-to-run-in-headless-mode.patch
Description: Binary data

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to