Re: Regarding gdbus-codegen

2013-07-18 Thread Tarnyko
John, 

John Emmas writes: 

At the time I tried versions 2.7 and 3.1 but they both gave me the same 
problem.  Going back to Tarnyko's email 


On 17/07/2013 19:55, Tarnyko wrote:


- in "gdbus-codegen", we have :
path="$PATH:/lib/gdbus-2.0"
from codegen import codegen_main 



That's a bit strange.  I don't have that first ($PATH) statement at all - 
but having said that, I didn't process gdbus-codegen.in.  I simply copied 
it to gdbus-codegen.  Perhaps I should have run it through some processor? 


No, it was a shortcut I took to describe the correct line, which is as you 
stated :
path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gdbus-2.0') 

I spotted some possible problems in your gdbus-codegen file : 


path = os.path.join('@datadir@', 'glib-2.0')


'@datadir@' should be '/lib' or whatever, fixes the parsing only, the line 
won't be used on Win32. 


import codegen_main


should be :
from codegen import codegen_main 

Tells the script to look into a 'codegen' subdir. 


Regards,
Tarnyko
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Regarding gdbus-codegen

2013-07-17 Thread John Emmas

On 18/07/2013 02:04, Fan Chun-wei wrote:


I also ran Python 2.7 in both x86 and x64 flavors in the same way 
Tarnyko ran the script (which I built myself using Visual Studio, so 
this is a native Windows build/version of Python, running under 
cmd.exe), and this worked for me too.




Thanks guys, that's quite interesting.

I can't quite remember where I obtained Python but the installer name 
seems to take the same format as the ones that are available here:-


http://www.python.org/getit/

At the time I tried versions 2.7 and 3.1 but they both gave me the same 
problem.  Going back to Tarnyko's email


On 17/07/2013 19:55, Tarnyko wrote:


- in "gdbus-codegen", we have :
path="$PATH:/lib/gdbus-2.0"
from codegen import codegen_main



That's a bit strange.  I don't have that first ($PATH) statement at all 
- but having said that, I didn't process gdbus-codegen.in.  I simply 
copied it to gdbus-codegen.  Perhaps I should have run it through some 
processor?  Currently (on my system) gdbus-codegen is as below.


John


# gdbus-codegen (from my system)
import os
import sys

srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)

if srcdir is not None:
path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
elif os.name == 'nt':
# Makes gdbus-codegen 'relocatable' at runtime on Windows.
path = os.path.join(os.path.dirname(__file__), '..', 'lib', 
'gdbus-2.0')

else:
path = os.path.join('@datadir@', 'glib-2.0')

sys.path.insert(0, os.path.abspath(path))
import codegen_main

sys.exit(codegen_main.codegen_main())

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Regarding gdbus-codegen

2013-07-17 Thread Fan Chun-wei

Hi John,


[Tarnyko wrote: ]
Hmmm, that's strange, works here.
- in "gdbus-codegen", we have :
path="$PATH:/lib/gdbus-2.0"
from codegen import codegen_main
- and in "/lib/gdbus-2.0/codegen/codegen_main.py" we have :
from . import config
where "config.py" is in the same directory.
Using Windows (not MSYS) Python 2.5, and GTK+3.6.4 from :
http://www.tarnyko.net/repo/gtk3_build_system
gtk+-bundle_3.6.4-20130513_win32.zip
Running :
python gdbus-codegen


I also ran Python 2.7 in both x86 and x64 flavors in the same way 
Tarnyko ran the script (which I built myself using Visual Studio, so 
this is a native Windows build/version of Python, running under 
cmd.exe), and this worked for me too.

---

Hi Tarnyko,

[Tarnyko wrote:]
Thanks for sharing. FYI, MinGW makefiles from latest master generate 
and install "gdbus-codegen" correctly. You may want to take 
inspiration from them if you plan to add gdbus-codegen generation 
for MSVC (don't know this toolchain enough to do it myself).

I just suggested a little path change  :
https://bugzilla.gnome.org/show_bug.cgi?id=702862
Thanks for the notes regarding this.  By looking at Makefile.am in 
$(srcroot)/gio/gdbus-2.0/codegen, I agree with you regarding this 
change.  Just wondering whether there are other people that might be 
looking at this though so that we can be more consistent across the 
various platforms that GLib supports.
BTW, I have updated the Visual Studio build files for gdbus-codegen in 
commit 95f7dc94 
 
on master-I will update it accordingly when your updates go in.


With blessings.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Regarding gdbus-codegen

2013-07-17 Thread Tarnyko
Hmmm, that's strange, works here. 


- in "gdbus-codegen", we have :
path="$PATH:/lib/gdbus-2.0"
from codegen import codegen_main
- and in "/lib/gdbus-2.0/codegen/codegen_main.py" we have :
from . import config
where "config.py" is in the same directory. 


Using Windows (not MSYS) Python 2.5, and GTK+3.6.4 from :
http://www.tarnyko.net/repo/gtk3_build_system
gtk+-bundle_3.6.4-20130513_win32.zip 


Running :
python gdbus-codegen 


Regards,
Tarnyko 

John Emmas writes: 

Thanks guys. 

My memory is hazy now but from what I can recall, any lines like this were 
always problematic;- 

  from . import some_module 

No matter what I did, I couldn't get (Windows) Python to understand what 
"from ." meant.  If the module to be imported was in a subfolder - e.g. 

  from the_subfolder import some_module 

that worked fine - but "from ." wouldn't work at all for me. 

John 



On 17/07/2013 16:15, Tarnyko wrote:

Hi Fan,
Thanks for sharing. FYI, MinGW makefiles from latest master generate and 
install "gdbus-codegen" correctly. You may want to take inspiration from 
them if you plan to add gdbus-codegen generation for MSVC (don't know 
this toolchain enough to do it myself).

I just suggested a little path change  :
https://bugzilla.gnome.org/show_bug.cgi?id=702862
Regards,
Tarnyko 


Fan Chun-wei writes:

Hi John,
(list people: I understand this is a rather old topic that was brought
up few months ago:) ).
I was poking around with the Python scripts for gdbus-codegen lately,
and I thought it might be good to let you know a few things about its
use on Windows, especially under Visual Studio builds of GLib
It appears that one wouldn't have to change anything in those Python
scripts (at least from the release stable/unstable tarballs) so that
they can be ran on Windows.
What I found is that for it to work "installed" on Windows (suppose your
GLib "installation" is in c:\foo):
-From $(srcroot)\gio\gdbus-2.0\codegen, copy the gdbus-codegen.in file
as-is to c:\foo\bin, and renaming it as gdbus-codegen. (This files has
support for Windows regarding path issues without needing to process the
file with autotools)
-Copy all the .py files in $(srcroot)\gio\gdbus-2.0\codegen to
c:\foo\lib\gdbus-2.0\codegen as is.
So this will basically work when you have the following layout
c:\
foo\
bin\
gdbus-codegen (renamed from gdbus-codegen.in)
lib\
gdbus-2.0\
codegen\
codegen.py
codegen_docbook.py
codegen_main.py
config.py
dbustypes.py
parser.py
utils.py
__init__.py
Hope this may be of help. Unfortunately I can't run the
gdbus-test-codegen test program as it uses items from GIO-UNIX, but it
does seem to me that generating the test sources in-tree (with
UNINSTALLED_GLIB_SRCDIR set) and using the script in the layout I just
mentioned (without UNINSTALLED_GLIB_SRCDIR set, obviously) produce
identical results.
With blessings.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list 



___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Regarding gdbus-codegen

2013-07-17 Thread John Emmas

Thanks guys.

My memory is hazy now but from what I can recall, any lines like this 
were always problematic;-


  from . import some_module

No matter what I did, I couldn't get (Windows) Python to understand what 
"from ." meant.  If the module to be imported was in a subfolder - e.g.


  from the_subfolder import some_module

that worked fine - but "from ." wouldn't work at all for me.

John


On 17/07/2013 16:15, Tarnyko wrote:

Hi Fan,
Thanks for sharing. FYI, MinGW makefiles from latest master generate 
and install "gdbus-codegen" correctly. You may want to take 
inspiration from them if you plan to add gdbus-codegen generation for 
MSVC (don't know this toolchain enough to do it myself).

I just suggested a little path change  :
https://bugzilla.gnome.org/show_bug.cgi?id=702862
Regards,
Tarnyko

Fan Chun-wei writes:

Hi John,
(list people: I understand this is a rather old topic that was brought
up few months ago:) ).
I was poking around with the Python scripts for gdbus-codegen lately,
and I thought it might be good to let you know a few things about its
use on Windows, especially under Visual Studio builds of GLib
It appears that one wouldn't have to change anything in those Python
scripts (at least from the release stable/unstable tarballs) so that
they can be ran on Windows.
What I found is that for it to work "installed" on Windows (suppose your
GLib "installation" is in c:\foo):
-From $(srcroot)\gio\gdbus-2.0\codegen, copy the gdbus-codegen.in file
as-is to c:\foo\bin, and renaming it as gdbus-codegen. (This files has
support for Windows regarding path issues without needing to process the
file with autotools)
-Copy all the .py files in $(srcroot)\gio\gdbus-2.0\codegen to
c:\foo\lib\gdbus-2.0\codegen as is.
So this will basically work when you have the following layout
c:\
foo\
bin\
gdbus-codegen (renamed from gdbus-codegen.in)
lib\
gdbus-2.0\
codegen\
codegen.py
codegen_docbook.py
codegen_main.py
config.py
dbustypes.py
parser.py
utils.py
__init__.py
Hope this may be of help. Unfortunately I can't run the
gdbus-test-codegen test program as it uses items from GIO-UNIX, but it
does seem to me that generating the test sources in-tree (with
UNINSTALLED_GLIB_SRCDIR set) and using the script in the layout I just
mentioned (without UNINSTALLED_GLIB_SRCDIR set, obviously) produce
identical results.
With blessings.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list



___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Regarding gdbus-codegen (was: Re: glib-mkenums in glib 2)

2013-07-17 Thread Tarnyko
Hi Fan, 

Thanks for sharing. FYI, MinGW makefiles from latest master generate and 
install "gdbus-codegen" correctly. You may want to take inspiration from 
them if you plan to add gdbus-codegen generation for MSVC (don't know this 
toolchain enough to do it myself). 

I just suggested a little path change  : 

https://bugzilla.gnome.org/show_bug.cgi?id=702862 


Regards,
Tarnyko 



Fan Chun-wei writes: 

Hi John, 


(list people: I understand this is a rather old topic that was brought
up few months ago:) ). 


I was poking around with the Python scripts for gdbus-codegen lately,
and I thought it might be good to let you know a few things about its
use on Windows, especially under Visual Studio builds of GLib
It appears that one wouldn't have to change anything in those Python
scripts (at least from the release stable/unstable tarballs) so that
they can be ran on Windows. 


What I found is that for it to work "installed" on Windows (suppose your
GLib "installation" is in c:\foo):
-From $(srcroot)\gio\gdbus-2.0\codegen, copy the gdbus-codegen.in file
as-is to c:\foo\bin, and renaming it as gdbus-codegen. (This files has
support for Windows regarding path issues without needing to process the
file with autotools)
-Copy all the .py files in $(srcroot)\gio\gdbus-2.0\codegen to
c:\foo\lib\gdbus-2.0\codegen as is. 


So this will basically work when you have the following layout
c:\
foo\
bin\
gdbus-codegen (renamed from gdbus-codegen.in)
lib\
gdbus-2.0\
codegen\
codegen.py
codegen_docbook.py
codegen_main.py
config.py
dbustypes.py
parser.py
utils.py
__init__.py 


Hope this may be of help. Unfortunately I can't run the
gdbus-test-codegen test program as it uses items from GIO-UNIX, but it
does seem to me that generating the test sources in-tree (with
UNINSTALLED_GLIB_SRCDIR set) and using the script in the layout I just
mentioned (without UNINSTALLED_GLIB_SRCDIR set, obviously) produce
identical results. 


With blessings.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list