Re: [python-win32] problems with win32comext\taskscheduler on windows

2010-05-04 Thread Vaida Bogdan
It seems that the Task Scheduler 2.0 enum types in TASK_TRIGGER_TYPE2 are not 
implemented:

These are for Task Scheduler 1.0
$ grep -rni TASK_TIME_TRIGGER_DAILY *
com/win32comext/taskscheduler/src/PyITaskTrigger.cpp:129:   
"TASK_TIME_TRIGGER_ONCE,TASK_TIME_TRIGGER_DAILY,\n"
com/win32comext/taskscheduler/src/PyITaskTrigger.cpp:133:   
{"Daily_DaysInterval", T_USHORT, 
OFF(task_trigger.Type.Daily.DaysInterval),0,"TASK_TIME_TRIGGER_DAILY"},
com/win32comext/taskscheduler/src/taskscheduler.cpp:40: 
PyModule_AddIntConstant(module,"TASK_TIME_TRIGGER_DAILY", 
TASK_TIME_TRIGGER_DAILY);
These are for Task Scheduler 2.0
$ grep -rni TASK_TRIGGER_DAILY *
$ 

http://msdn.microsoft.com/en-us/library/aa383915(v=VS.85).aspx

Is Task Scheduler 2.0 supported in pywin32 or can you provide me with some 
ideas on how to make it work? (my code is located here: 
http://pastebin.com/bmg847hw )

Thanks in advance,
  Bogdan

On 4, May, 2010, at 7:08 AM, Roger Upole wrote:

> Does job.GetTriggerCount() return 1 ?
> If it does, but the trigger doesn't appear in the
> Task Scheduler UI, most likely there's
> something it doesn't like about the trigger's
> flags.
> 
> Roger
> 
> ___
> python-win32 mailing list
> python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] finding pythonXX.dll?

2010-05-04 Thread Bill Janssen
Roger Upole  wrote:

> Bill Janssen wrote:
> > Is there anyway to tell, from inside Python, where the python26.dll file
> > is?  I've got to install the win32 dlls in the same directory.
> >
> > I see that sys contains a symbol "dllhandle", but that's just a
> > numeric handle.
> >
> > Bill
> 
> win32api.GetModuleFileName(sys.dllhandle)
> 
>  Roger

Sorry, I wasn't clear enough.  I'm trying to figure out where to install
the win32 dlls, so I can't use them in that determination.

Bill
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] finding pythonXX.dll?

2010-05-04 Thread Thomas Heller
Bill Janssen schrieb:
> Roger Upole  wrote:
> 
>> Bill Janssen wrote:
>> > Is there anyway to tell, from inside Python, where the python26.dll file
>> > is?  I've got to install the win32 dlls in the same directory.
>> >
>> > I see that sys contains a symbol "dllhandle", but that's just a
>> > numeric handle.
>> >
>> > Bill
>> 
>> win32api.GetModuleFileName(sys.dllhandle)
>> 
>>  Roger
> 
> Sorry, I wasn't clear enough.  I'm trying to figure out where to install
> the win32 dlls, so I can't use them in that determination.

Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> buf = create_string_buffer(256)
>>> windll.kernel32.GetModuleFileNameA
<_FuncPtr object at 0x00B44B70>
>>> import sys
>>> windll.kernel32.GetModuleFileNameA(sys.dllhandle, byref(buf), 256)
32
>>> buf.value
'C:\\WINDOWS\\system32\\python26.dll'
>>>

-- 
Thomas

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] finding pythonXX.dll?

2010-05-04 Thread Bill Janssen
Thomas Heller  wrote:

> Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] 
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from ctypes import *
> >>> buf = create_string_buffer(256)
> >>> windll.kernel32.GetModuleFileNameA
> <_FuncPtr object at 0x00B44B70>
> >>> import sys
> >>> windll.kernel32.GetModuleFileNameA(sys.dllhandle, byref(buf), 256)
> 32
> >>> buf.value
> 'C:\\WINDOWS\\system32\\python26.dll'
> >>>

Excellent -- just what I need!  Thanks.

Bill
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Boot strap mechanism for ActiveX Python engines

2010-05-04 Thread Marc-Andre Belzile
Hi,

I'm trying to execute some python code when a new ActiveX Python engine is 
instantiated. I thought I could use sitecustomize.py to put my code in but this 
module seems to get executed only for the first engine created (probably when 
pythoncomXX.dll is loaded for the first time).

 Is there a different python module I can rely on when a new engine is created 
? Or maybe there is another way to call a python script when a new engine is 
created ?

Thanks for your help

-mab

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Boot strap mechanism for ActiveX Python engines

2010-05-04 Thread Mark Hammond

On 5/05/2010 5:33 AM, Marc-Andre Belzile wrote:

Hi,

I'm trying to execute some python code when a new ActiveX Python engine
is instantiated. I thought I could use sitecustomize.py to put my code
in but this module seems to get executed only for the first engine
created (probably when pythoncomXX.dll is loaded for the first time).

Is there a different python module I can rely on when a new engine is
created ? Or maybe there is another way to call a python script when a
new engine is created ?


Your best bet is probably to create your own subclass of the axscript 
implementation (with different CLSID) and override (eg) InitNew to take 
some action as the engine is initialized.


Cheers,

Mark
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32