Re: [Geany-Devel] Python question

2014-04-26 Thread Pavel Roschin
It should be in the current library (not sure correct term), like if it was C, you would call `dlopen(NULL, ...)`. I'm not familiar enough with ctypes to say exactly but if it had a function like `load_library()` I'd expect you would pass `None` where it expects a filename. Alternatively,

Re: [Geany-Devel] Python question

2014-04-26 Thread Lex Trotman
On 26 April 2014 17:50, Pavel Roschin ros...@scriptumplus.ru wrote: It should be in the current library (not sure correct term), like if it was C, you would call `dlopen(NULL, ...)`. I'm not familiar enough with ctypes to say exactly but if it had a function like `load_library()` I'd expect

Re: [Geany-Devel] Python question

2014-04-26 Thread Pavel Roschin
***VERY*** evil :-D It is :-D Is int the same size as pointer on your system? On windows in particular int can be 32 bit and pointer 64 bit. With both ways (int, long) I can't achieve result. Seems that this is not actual doc pointer or something. Without native binding can't imagine how to

Re: [Geany-Devel] Python question

2014-04-26 Thread Matthew Brush
On 14-04-26 12:50 AM, Pavel Roschin wrote: It should be in the current library (not sure correct term), like if it was C, you would call `dlopen(NULL, ...)`. I'm not familiar enough with ctypes to say exactly but if it had a function like `load_library()` I'd expect you would pass `None` where

Re: [Geany-Devel] Python question

2014-04-26 Thread Matthew Brush
On 14-04-26 12:50 AM, Pavel Roschin wrote: It should be in the current library (not sure correct term), like if it was C, you would call `dlopen(NULL, ...)`. I'm not familiar enough with ctypes to say exactly but if it had a function like `load_library()` I'd expect you would pass `None` where

Re: [Geany-Devel] Python question

2014-04-26 Thread Pavel Roschin
Is it possible that `GPointer` is a `PyCapsule` (or `PyCObject`) and not an actual `void*` pointing directly to a `GeanyDocument*`? I'm not advanced pyhton user so I assume that it is (e.g. pygkt creates this wrap). But I took an example from here:

Re: [Geany-Devel] Python question

2014-04-26 Thread Pavel Roschin
Another (untested) hack that might work: def geanypy_path(): import geany, os path = os.path.dirname( os.path.dirname(os.path.dirname(geany.__file__))) return os.path.join(path, geanypy.so) Cheers, Matthew Brush It works good too, but as I mentioned above,

Re: [Geany-Devel] Python question

2014-04-26 Thread Lex Trotman
On 27 April 2014 03:43, Pavel Roschin ros...@scriptumplus.ru wrote: Another (untested) hack that might work: def geanypy_path(): import geany, os path = os.path.dirname( os.path.dirname(os.path.dirname(geany.__file__))) return os.path.join(path, geanypy.so)

Re: [Geany-Devel] Python question

2014-04-25 Thread Matthew Brush
On 14-04-24 09:44 PM, Pavel Roschin wrote: I'm played with GeanyPy plugin and faced with a problem. Here is the source code I created to get current document from sidebar: def press(self, widget, event, data=None): if event.button != 2: return

Re: [Geany-Devel] Python question

2014-04-25 Thread Matthew Brush
On 14-04-24 11:35 PM, Matthew Brush wrote: On 14-04-24 09:44 PM, Pavel Roschin wrote: I'm played with GeanyPy plugin and faced with a problem. Here is the source code I created to get current document from sidebar: def press(self, widget, event, data=None): if event.button != 2:

Re: [Geany-Devel] Python question

2014-04-25 Thread Pavel Roschin
On 14-04-24 09:44 PM, Pavel Roschin wrote: I'm played with GeanyPy plugin and faced with a problem. Here is the source code I created to get current document from sidebar: def press(self, widget, event, data=None): if event.button != 2: return

Re: [Geany-Devel] Python question

2014-04-25 Thread Matthew Brush
On 14-04-25 10:18 AM, Pavel Roschin wrote: On 14-04-24 09:44 PM, Pavel Roschin wrote: I'm played with GeanyPy plugin and faced with a problem. Here is the source code I created to get current document from sidebar: def press(self, widget, event, data=None): if

Re: [Geany-Devel] Python question

2014-04-25 Thread Lex Trotman
It should be in the current library (not sure correct term), like if it was C, you would call `dlopen(NULL, ...)`. I'm not familiar enough with ctypes to say exactly but if it had a function like `load_library()` I'd expect you would pass `None` where it expects a filename. Alternatively, you

[Geany-Devel] Python question

2014-04-24 Thread Pavel Roschin
I'm played with GeanyPy plugin and faced with a problem. Here is the source code I created to get current document from sidebar: def press(self, widget, event, data=None): if event.button != 2: return mod, it =