Discussion:
Submakefile
(too old to reply)
John Thornton
2017-02-04 11:55:55 UTC
Permalink
Raw Message
I wrote a GUI to launch the latency-histogram with all the options
available to select. The GUI disappears when the latency-histogram is
running and reappears when you shut it down so you can change options.

I've created a directory in src/emc/usr_intf/lhgui and put my files in
there. I looked at the gscreen Submakefile and I'm somewhat stumped
what is going on. The first line is:

GSCREEN_MODULES = mdi emc_interface preferences keybindings

What does the above line do?

Thanks
JT
Chris Morley
2017-02-04 22:03:12 UTC
Permalink
Raw Message
This is a variable to hold the names of libraries that gscreen uses.

they are later copied from gscreen's folder to lib/python/gscreen


Chris M


________________________________
From: John Thornton <***@gnipsel.com>
Sent: February 4, 2017 11:55 AM
To: EMC developers
Subject: [Emc-developers] Submakefile

I wrote a GUI to launch the latency-histogram with all the options
available to select. The GUI disappears when the latency-histogram is
running and reappears when you shut it down so you can change options.

I've created a directory in src/emc/usr_intf/lhgui and put my files in
there. I looked at the gscreen Submakefile and I'm somewhat stumped
what is going on. The first line is:

GSCREEN_MODULES = mdi emc_interface preferences keybindings

What does the above line do?

Thanks
JT

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Slashdot: News for nerds, stuff that matters<http://sdm.link/slashdot>
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.


_______________________________________________
Emc-developers mailing list
Emc-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers
Emc-developers Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developers>
lists.sourceforge.net
The Enhanced Machine Controller (EMC) is a CNC machine controller that runs on Linux and is available under the terms of the GNU General Public License.
John Thornton
2017-02-05 12:15:46 UTC
Permalink
Raw Message
Thanks Chris,

Now I see how you used that.

The PYTARGETS I assume is where the files get installed on the users
computer?

JT
Post by Chris Morley
This is a variable to hold the names of libraries that gscreen uses.
they are later copied from gscreen's folder to lib/python/gscreen
Chris M
________________________________
Sent: February 4, 2017 11:55 AM
To: EMC developers
Subject: [Emc-developers] Submakefile
I wrote a GUI to launch the latency-histogram with all the options
available to select. The GUI disappears when the latency-histogram is
running and reappears when you shut it down so you can change options.
I've created a directory in src/emc/usr_intf/lhgui and put my files in
there. I looked at the gscreen Submakefile and I'm somewhat stumped
GSCREEN_MODULES = mdi emc_interface preferences keybindings
What does the above line do?
Thanks
JT
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Slashdot: News for nerds, stuff that matters<http://sdm.link/slashdot>
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
Emc-developers Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developers>
lists.sourceforge.net
The Enhanced Machine Controller (EMC) is a CNC machine controller that runs on Linux and is available under the terms of the GNU General Public License.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
John Thornton
2017-02-05 12:46:18 UTC
Permalink
Raw Message
I found that is in the Makefile...

JT
Post by John Thornton
Thanks Chris,
Now I see how you used that.
The PYTARGETS I assume is where the files get installed on the users
computer?
JT
Post by Chris Morley
This is a variable to hold the names of libraries that gscreen uses.
they are later copied from gscreen's folder to lib/python/gscreen
Chris M
________________________________
Sent: February 4, 2017 11:55 AM
To: EMC developers
Subject: [Emc-developers] Submakefile
I wrote a GUI to launch the latency-histogram with all the options
available to select. The GUI disappears when the latency-histogram is
running and reappears when you shut it down so you can change options.
I've created a directory in src/emc/usr_intf/lhgui and put my files in
there. I looked at the gscreen Submakefile and I'm somewhat stumped
GSCREEN_MODULES = mdi emc_interface preferences keybindings
What does the above line do?
Thanks
JT
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Slashdot: News for nerds, stuff that matters<http://sdm.link/slashdot>
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
Emc-developers Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developers>
lists.sourceforge.net
The Enhanced Machine Controller (EMC) is a CNC machine controller that runs on Linux and is available under the terms of the GNU General Public License.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
John Thornton
2017-02-08 12:36:23 UTC
Permalink
Raw Message
When I build my branch it builds without any errors. The lhgui.py file
gets the first line changed from:
#! /usr/bin/env python3
to
#!/usr/bin/python
when it is copied to /bin. Which makes the program not work. I'm
wondering if there is something in my Submakefile that is doing that?

I somewhat suspect that this line is the culprit but not sure what to do
with it.

$(Q)$(PYTHON) -c 'import sys; compile(open(sys.argv[1]).read(),
sys.argv[1], "exec")' $<

JT

Submakefile
LHGUI_MODULES = lh_gui

PYTARGETS += ../bin/lhgui ../lib/python/lhgui/__init__.py $(patsubst
%,../lib/python/lhgui/%.py,$(LHGUI_MODULES)) \

PYI18NSRCS += emc/usr_intf/lhgui/lhgui.py $(patsubst
%,emc/usr_intf/lhgui/%.py,$(LHGUI_MODULES)) \
emc/usr_intf/lhgui/lh_gui.ui

../lib/python/lhgui/__init__.py:
@mkdir -p ../lib/python/lhgui
@touch $@

../lib/python/lhgui/%: emc/usr_intf/lhgui/%
@$(ECHO) Syntax checking python script $(notdir $@)
$(Q)$(PYTHON) -c 'import sys; compile(open(sys.argv[1]).read(),
sys.argv[1], "exec")' $<
$(ECHO) Copying python script $(notdir $@)
$(Q)mkdir -p ../lib/python/lhgui
$(Q)cp $< $@

../share/linuxcnc/lh_gui.ui: emc/usr_intf/lhgui/lh_gui.ui
$(ECHO) Copying ui file $(notdir $@)
$(Q)mkdir -p $(dir $@)
$(Q)cp -f $< $@

../bin/lhgui: emc/usr_intf/lhgui/lhgui.py
@$(ECHO) Syntax checking python script $(notdir $@)
$(Q)$(PYTHON) -c 'import sys; compile(open(sys.argv[1]).read(),
sys.argv[1], "exec")' $<
$(ECHO) Copying python script $(notdir $@)
$(Q)(echo '#!$(PYTHON)'; sed '1 { /^#!/d; }' $<) > $@.tmp && chmod
+x $@.tmp && mv -f $@.tmp $@
Sebastian Kuzminsky
2017-02-08 15:53:14 UTC
Permalink
Raw Message
Post by John Thornton
When I build my branch it builds without any errors. The lhgui.py file
#! /usr/bin/env python3
to
#!/usr/bin/python
when it is copied to /bin. Which makes the program not work. I'm
wondering if there is something in my Submakefile that is doing that?
All our existing python programs and libraries are for python2, and our
build system doesn't expect to have a different python interpreter involved.

Our configure system (src/configure.in) currently requires that
/usr/bin/python (or whatever you specify with --with-python=) is at
least 2.7 (explicitly checked), and less than 3 (implicitly checked by
using python2 syntax in our checks).

So i think your options are to either rewrite your gui for python2, or
rewrite our configure/build/package system to handle mixed
python2/python3 code.
--
Sebastian Kuzminsky
andy pugh
2017-02-08 16:19:17 UTC
Permalink
Raw Message
Out of interest, has anyone experimented with running all our Python
through 2to3?

http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html
--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
John Thornton
2017-02-08 18:54:21 UTC
Permalink
Raw Message
I'd think that would be a good test to do on a scratch branch to see
what breaks... of course configure.in has to be changed as well which at
this point seems a bit over my skill level.

JT
Post by andy pugh
Out of interest, has anyone experimented with running all our Python
through 2to3?
http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html
Niemand Sonst
2017-02-08 18:40:39 UTC
Permalink
Raw Message
Post by Sebastian Kuzminsky
Post by John Thornton
When I build my branch it builds without any errors. The lhgui.py file
#! /usr/bin/env python3
to
#!/usr/bin/python
when it is copied to /bin. Which makes the program not work. I'm
wondering if there is something in my Submakefile that is doing that?
All our existing python programs and libraries are for python2, and our
build system doesn't expect to have a different python interpreter involved.
Our configure system (src/configure.in) currently requires that
/usr/bin/python (or whatever you specify with --with-python=) is at
least 2.7 (explicitly checked), and less than 3 (implicitly checked by
using python2 syntax in our checks).
So i think your options are to either rewrite your gui for python2, or
rewrite our configure/build/package system to handle mixed
python2/python3 code.
IMHO it would be a good preparation to chnage the configure stuff to
support both python 2 and 3, as we will be forced to change to python 3
sooner or later. And py3 has some advantages against py2.


Norbert
John Thornton
2017-02-08 18:53:05 UTC
Permalink
Raw Message
I do think that option number B is the best for moving forward with
LinuxCNC. I spent some time cruising through configure.in and see where
it checks for at least 2.7 or greater but the implicit check eludes me...

Option number A is the easy way out for sure for me to do but I'll keep
looking at the configure.in for a while and see if it makes sense after
a while...

The GUI is Python with PyQt which seems to be easier to work with than
PyGtk. Stuff doesn't have a mind of it's own in PyQt like PyGtk.

Thanks
JT
Post by Sebastian Kuzminsky
Post by John Thornton
When I build my branch it builds without any errors. The lhgui.py file
#! /usr/bin/env python3
to
#!/usr/bin/python
when it is copied to /bin. Which makes the program not work. I'm
wondering if there is something in my Submakefile that is doing that?
All our existing python programs and libraries are for python2, and our
build system doesn't expect to have a different python interpreter involved.
Our configure system (src/configure.in) currently requires that
/usr/bin/python (or whatever you specify with --with-python=) is at
least 2.7 (explicitly checked), and less than 3 (implicitly checked by
using python2 syntax in our checks).
So i think your options are to either rewrite your gui for python2, or
rewrite our configure/build/package system to handle mixed
python2/python3 code.
Loading...