problem with ets up

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with ets up

Brennan Williams
I'm attempting to move my development environment from XP to Vista (on
the same machine - my XP installation has slowed to a crawl).

I'm getting the following when I do an ""ets up" on ETS_3.3.1

Traceback (most recent call last):
  File "c:\python25\scripts\ets-script.py", line 8, in <module>
    load_entry_point('ETSProjectTools==0.6.0.dev-r24867',
'console_scripts', 'ets')()
  File
"c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\ets.py",
line 155, in main
    args.func(args, cfg)
  File
"c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\update.py",
line 69, in main
    checkouts.perform(command, dry_run=args.dry_run, required_files=[])
  File
"c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\tools\checkouts.py",
line 116, in perform
    retcode = subprocess.call(cmd, cwd=project)
  File "C:\Python25\lib\subprocess.py", line 444, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\Python25\lib\subprocess.py", line 822, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified


in c:\python25\lib\subprocess.py it is doing an _execute_child.

I chucked in a few print statements and so hysr prior to the traceback I
get...

executable=None
GetVersion=393216006
args= svn up .
creationflags= 0
env= None
cwd= E:\enthought\ETS_3.3.1\AppTools_3.3.1
startupinfo=<subprocess.STARTUPINFO instance at 0x02068AF8>

It works under XP. It is possible my Python installation under Vista is
slightly different (but hopefully it is the same) so is this a Vista
problem with how a subprocess is fired up?

ANy ideas?

Thanks

Brennan



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: problem with ets up

Gael Varoquaux
On Sun, Jan 17, 2010 at 02:03:47PM +1300, Brennan Williams wrote:
> I'm attempting to move my development environment from XP to Vista (on
> the same machine - my XP installation has slowed to a crawl).

> I'm getting the following when I do an ""ets up" on ETS_3.3.1

> Traceback (most recent call last):
>   File "c:\python25\scripts\ets-script.py", line 8, in <module>
>     load_entry_point('ETSProjectTools==0.6.0.dev-r24867',
> 'console_scripts', 'ets')()
>   File
> "c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\ets.py",
> line 155, in main
>     args.func(args, cfg)
>   File
> "c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\update.py",
> line 69, in main
>     checkouts.perform(command, dry_run=args.dry_run, required_files=[])
>   File
> "c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\tools\checkouts.py",
> line 116, in perform
>     retcode = subprocess.call(cmd, cwd=project)
>   File "C:\Python25\lib\subprocess.py", line 444, in call
>     return Popen(*popenargs, **kwargs).wait()
>   File "C:\Python25\lib\subprocess.py", line 594, in __init__
>     errread, errwrite)
>   File "C:\Python25\lib\subprocess.py", line 822, in _execute_child
>     startupinfo)
> WindowsError: [Error 2] The system cannot find the file specified

Can you run 'svn' on the command line? I am wondering if it is not simply
that SVN is missing.

If its the case, the error message could be improved.

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: problem with ets up

Brennan Williams
Gael Varoquaux wrote:

> On Sun, Jan 17, 2010 at 02:03:47PM +1300, Brennan Williams wrote:
>  
>> I'm attempting to move my development environment from XP to Vista (on
>> the same machine - my XP installation has slowed to a crawl).
>>    
>
>  
>> I'm getting the following when I do an ""ets up" on ETS_3.3.1
>>    
>
>  
>> Traceback (most recent call last):
>>   File "c:\python25\scripts\ets-script.py", line 8, in <module>
>>     load_entry_point('ETSProjectTools==0.6.0.dev-r24867',
>> 'console_scripts', 'ets')()
>>   File
>> "c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\ets.py",
>> line 155, in main
>>     args.func(args, cfg)
>>   File
>> "c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\update.py",
>> line 69, in main
>>     checkouts.perform(command, dry_run=args.dry_run, required_files=[])
>>   File
>> "c:\python25\lib\site-packages\ETSProjectTools-0.6.0.dev_r24867-py2.5.egg\enthought\ets\tools\checkouts.py",
>> line 116, in perform
>>     retcode = subprocess.call(cmd, cwd=project)
>>   File "C:\Python25\lib\subprocess.py", line 444, in call
>>     return Popen(*popenargs, **kwargs).wait()
>>   File "C:\Python25\lib\subprocess.py", line 594, in __init__
>>     errread, errwrite)
>>   File "C:\Python25\lib\subprocess.py", line 822, in _execute_child
>>     startupinfo)
>> WindowsError: [Error 2] The system cannot find the file specified
>>    
>
> Can you run 'svn' on the command line? I am wondering if it is not simply
> that SVN is missing.
>
> If its the case, the error message could be improved.
>
>  

'svn' is not recognised etc etc.

I have TortoiseSVN installed but just ran it and got a dialog with...

"This application has failed to start because libapr_tsvn.dll was not
found....."

I installed TortoiseSVN so long ago (on both XP and Vista) that I'm not
sure whether that is the problem or whether I should have a command line
version of svn installed as well.?

I'll download and install TortoiseSVN again and see if anything changes.

Brennan



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: problem with ets up

bryce hendrix-2
On 1/17/2010 4:12 PM, Brennan Williams wrote:

>
> 'svn' is not recognised etc etc.
>
> I have TortoiseSVN installed but just ran it and got a dialog with...
>
> "This application has failed to start because libapr_tsvn.dll was not
> found....."
>
> I installed TortoiseSVN so long ago (on both XP and Vista) that I'm not
> sure whether that is the problem or whether I should have a command line
> version of svn installed as well.?
>    

I think you need a command line version of svn. It would be nice if
there was a pure python version someday...

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: problem with ets up

Gael Varoquaux
In reply to this post by Brennan Williams
On Mon, Jan 18, 2010 at 11:12:18AM +1300, Brennan Williams wrote:
> > Can you run 'svn' on the command line? I am wondering if it is not simply
> > that SVN is missing.

> > If its the case, the error message could be improved.



> 'svn' is not recognised etc etc.

That's your problem.

> I have TortoiseSVN installed but just ran it and got a dialog with...

Well, anyhow, I believe that Tortoise does not come with a command line
version of svn. You can download one on the net, but I don't remember
where...

HTH,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: problem with ets up

Peter Wang
On Jan 18, 2010, at 2:46 AM, Gael Varoquaux wrote:
>> I have TortoiseSVN installed but just ran it and got a dialog with...
>
> Well, anyhow, I believe that Tortoise does not come with a command  
> line
> version of svn. You can download one on the net, but I don't remember
> where...


Official Collabnet download page:
http://www.collab.net/downloads/subversion/

This requires you to create a free login.  If you'd rather not go  
through that hassle, you can download MSIs from SlikSVN: http://www.sliksvn.com/en/download

32-bit: http://www.sliksvn.com/pub/Slik-Subversion-1.6.6-win32.msi
64-bit: http://www.sliksvn.com/pub/Slik-Subversion-1.6.6-x64.msi

-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: problem with ets up

Brennan Williams
Peter Wang wrote:

> On Jan 18, 2010, at 2:46 AM, Gael Varoquaux wrote:
>  
>>> I have TortoiseSVN installed but just ran it and got a dialog with...
>>>      
>> Well, anyhow, I believe that Tortoise does not come with a command  
>> line
>> version of svn. You can download one on the net, but I don't remember
>> where...
>>    
>
>
> Official Collabnet download page:
> http://www.collab.net/downloads/subversion/
>
> This requires you to create a free login.  If you'd rather not go  
> through that hassle, you can download MSIs from SlikSVN: http://www.sliksvn.com/en/download
>
> 32-bit: http://www.sliksvn.com/pub/Slik-Subversion-1.6.6-win32.msi
> 64-bit: http://www.sliksvn.com/pub/Slik-Subversion-1.6.6-x64.msi
>
>  
Thanks for all the pointers. I went to....

http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91

and downloaded and installed subversion 1.5.6, then rebooted and ets up
is now working.

Regards

Brennan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Pb with TableEditor

Boiteux, Benoit
Hello,

I just tried to use a TableEditor to display the content of a list(similar to EPDLab examples)

devices = ('probe1','probe2')
edit_view = View(
                      HGroup(
                            Item('devices',
                                 editor = TabularEditor(
                                                        show_titles=False,
                                                        editable=False,
                                                        multi_select=False),
                                 show_label = False),
...

When I .configure_traits the class(HasTraits) that includes this view, I get the following error:
  File "c:\python25\lib\site-packages\TraitsBackendWX-3.1.0-py2.5.egg\enthought\traits\ui\wx\tabular_editor.py", line 109, in OnGetItemAttr
  File "c:\python25\lib\site-packages\Traits-3.1.0-py2.5-win32.egg\enthought\traits\ui\tabular_adapter.py", line 279, in get_bg_color
  File "c:\python25\lib\site-packages\Traits-3.1.0-py2.5-win32.egg\enthought\traits\ui\tabular_adapter.py", line 462, in _result_for
IndexError: list index out of range

I don't really understand my problem..would you have an idea?

Thanks
Benoit
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Didrik Pinte
On Tue, 2010-01-19 at 10:29 +0000, Boiteux, Benoit wrote:

> Hello,
>
> I just tried to use a TableEditor to display the content of a list(similar to EPDLab examples)
>
> devices = ('probe1','probe2')
> edit_view = View(
>                       HGroup(
>                             Item('devices',
>                                  editor = TabularEditor(
>                                                         show_titles=False,
>                                                         editable=False,
>                                                         multi_select=False),
>                                  show_label = False),
> ...
>
> When I .configure_traits the class(HasTraits) that includes this view, I get the following error:
>   File "c:\python25\lib\site-packages\TraitsBackendWX-3.1.0-py2.5.egg\enthought\traits\ui\wx\tabular_editor.py", line 109, in OnGetItemAttr
>   File "c:\python25\lib\site-packages\Traits-3.1.0-py2.5-win32.egg\enthought\traits\ui\tabular_adapter.py", line 279, in get_bg_color
>   File "c:\python25\lib\site-packages\Traits-3.1.0-py2.5-win32.egg\enthought\traits\ui\tabular_adapter.py", line 462, in _result_for
> IndexError: list index out of range
>
> I don't really understand my problem..would you have an idea?
Hi Benoit,

You use a TabularEditor and not a TableEditor in your example. To make
this work, you must define a TabularAdapter. This is the interface used
by the TabularEditor to access your data and display attributes. Have a
look here for more information and an example :
- https://svn.enthought.com/enthought/wiki/Traits_3_0_tabular_editor
-
https://svn.enthought.com/enthought/wiki/Traits_3_0_person_tabular_editor_example


If you want to use TableEditor, you should have a List(Instance) as
input and not a list of str.

-- Didrik


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Boiteux, Benoit
Thanks,
With an adapter, it works well!
Adapter is mandatory to implement each time you use a TableEditor or a TabularEditor?

Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Didrik Pinte
Sent: Tuesday, January 19, 2010 1:49 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

On Tue, 2010-01-19 at 10:29 +0000, Boiteux, Benoit wrote:

> Hello,
>
> I just tried to use a TableEditor to display the content of a
> list(similar to EPDLab examples)
>
> devices = ('probe1','probe2')
> edit_view = View(
>                       HGroup(
>                             Item('devices',
>                                  editor = TabularEditor(
>                                                         show_titles=False,
>                                                         editable=False,
>                                                         multi_select=False),
>                                  show_label = False), ...
>
> When I .configure_traits the class(HasTraits) that includes this view, I get the following error:
>   File "c:\python25\lib\site-packages\TraitsBackendWX-3.1.0-py2.5.egg\enthought\traits\ui\wx\tabular_editor.py", line 109, in OnGetItemAttr
>   File "c:\python25\lib\site-packages\Traits-3.1.0-py2.5-win32.egg\enthought\traits\ui\tabular_adapter.py", line 279, in get_bg_color
>   File
> "c:\python25\lib\site-packages\Traits-3.1.0-py2.5-win32.egg\enthought\
> traits\ui\tabular_adapter.py", line 462, in _result_for
> IndexError: list index out of range
>
> I don't really understand my problem..would you have an idea?

Hi Benoit,

You use a TabularEditor and not a TableEditor in your example. To make this work, you must define a TabularAdapter. This is the interface used by the TabularEditor to access your data and display attributes. Have a look here for more information and an example :
- https://svn.enthought.com/enthought/wiki/Traits_3_0_tabular_editor
-
https://svn.enthought.com/enthought/wiki/Traits_3_0_person_tabular_editor_example


If you want to use TableEditor, you should have a List(Instance) as input and not a list of str.

-- Didrik

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Didrik Pinte
On Tue, 2010-01-19 at 13:12 +0000, Boiteux, Benoit wrote:
> Thanks,
> With an adapter, it works well!
> Adapter is mandatory to implement each time you use a TableEditor or a TabularEditor?
>
> Benoit

No need for the TableEditor.

For the TabularEditor, if you do not provide your specific tabular
adapter, it will use the default one from
enthought.traits.ui.tabular_adapter.TabularAdapter.

-- Didrik

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Boiteux, Benoit
Good!
One last question:
I finally used a ListStrEditor, and I wonder how to get the selected item index/name of a list?

Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Didrik Pinte
Sent: Tuesday, January 19, 2010 3:48 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

On Tue, 2010-01-19 at 13:12 +0000, Boiteux, Benoit wrote:
> Thanks,
> With an adapter, it works well!
> Adapter is mandatory to implement each time you use a TableEditor or a TabularEditor?
>
> Benoit

No need for the TableEditor.

For the TabularEditor, if you do not provide your specific tabular adapter, it will use the default one from enthought.traits.ui.tabular_adapter.TabularAdapter.

-- Didrik
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Boiteux, Benoit
I found it, just need to declare a selected_index = 'index' where index=Int

Not easy ETS :)

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Boiteux, Benoit
Sent: Tuesday, January 19, 2010 3:54 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

Good!
One last question:
I finally used a ListStrEditor, and I wonder how to get the selected item index/name of a list?

Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Didrik Pinte
Sent: Tuesday, January 19, 2010 3:48 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

On Tue, 2010-01-19 at 13:12 +0000, Boiteux, Benoit wrote:
> Thanks,
> With an adapter, it works well!
> Adapter is mandatory to implement each time you use a TableEditor or a TabularEditor?
>
> Benoit

No need for the TableEditor.

For the TabularEditor, if you do not provide your specific tabular adapter, it will use the default one from enthought.traits.ui.tabular_adapter.TabularAdapter.

-- Didrik
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Didrik Pinte
In reply to this post by Boiteux, Benoit
On Tue, 2010-01-19 at 14:54 +0000, Boiteux, Benoit wrote:
> Good!
> One last question:
> I finally used a ListStrEditor, and I wonder how to get the selected item index/name of a list?
>
> Benoit


Hello Benoit,

Here is an example retrieving the selected item index. Using the
selected traits of the ListStrEditor, you can have the name.


from enthought.traits.api import Str, ListStr, HasTraits, Int
from enthought.traits.ui.api import View, Item, ListStrEditor

class ListStrTest(HasTraits):
    probes = ListStr
    probe_idx = Int

    def _probe_idx_changed(self):
        if self.probe_idx > -1:
            print self.probe_idx

    traits_view = View(Item('probes',
                      editor=ListStrEditor(selected_index='probe_idx')))

if __name__ == '__main__':
    demo = ListStrTest(probes=['probe1', 'probe2', 'probe3'])
    demo.configure_traits()


-- Didrik

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

Boiteux, Benoit
Thanks Didrik.

There is something with Traits that is confusing: when you want to close a window.
1- If I create a view with an [OKButton], how can I get the event to perform actions before the window closes ?
2- Or If I manually create a button like ok = Button('OK'), I get event with _ok_fired method, but how can I close the view from this handler?

Thanks
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Didrik Pinte
Sent: Tuesday, January 19, 2010 4:20 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

On Tue, 2010-01-19 at 14:54 +0000, Boiteux, Benoit wrote:
> Good!
> One last question:
> I finally used a ListStrEditor, and I wonder how to get the selected item index/name of a list?
>
> Benoit


Hello Benoit,

Here is an example retrieving the selected item index. Using the selected traits of the ListStrEditor, you can have the name.


from enthought.traits.api import Str, ListStr, HasTraits, Int from enthought.traits.ui.api import View, Item, ListStrEditor

class ListStrTest(HasTraits):
    probes = ListStr
    probe_idx = Int

    def _probe_idx_changed(self):
        if self.probe_idx > -1:
            print self.probe_idx

    traits_view = View(Item('probes',
                      editor=ListStrEditor(selected_index='probe_idx')))

if __name__ == '__main__':
    demo = ListStrTest(probes=['probe1', 'probe2', 'probe3'])
    demo.configure_traits()


-- Didrik
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Pb with TableEditor

bryce hendrix-2
Boiteux, Benoit wrote:
> Thanks Didrik.
>
> There is something with Traits that is confusing: when you want to close a window.
> 1- If I create a view with an [OKButton], how can I get the event to perform actions before the window closes ?
>  

Define a handler as a subclass of Handler, overload the close() method,
then instantiate that handler in the View() call.

> 2- Or If I manually create a button like ok = Button('OK'), I get event with _ok_fired method, but how can I close the view from this handler?
>  

You would most likely need to do so from a handler, so I recommend
approach #1.

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Pb with TableEditor

Boiteux, Benoit
Thanks !

close() method has only an info parameter that gives data on the UI.
How can we get access to Traits contained in the window we close ?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of bryce hendrix
Sent: Tuesday, January 19, 2010 5:49 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

Boiteux, Benoit wrote:
> Thanks Didrik.
>
> There is something with Traits that is confusing: when you want to close a window.
> 1- If I create a view with an [OKButton], how can I get the event to perform actions before the window closes ?
>  

Define a handler as a subclass of Handler, overload the close() method,
then instantiate that handler in the View() call.

> 2- Or If I manually create a button like ok = Button('OK'), I get event with _ok_fired method, but how can I close the view from this handler?
>  

You would most likely need to do so from a handler, so I recommend
approach #1.

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Pb with TableEditor

Boiteux, Benoit
I got it!
To summarize, when you want to perform actions when you close a panel with Ok buton:

Create a handler, a subclass of Handler, and set handler attribute of your view with this handler.
Override close(self,info, is_ok) method.
If you want to access traits from this handler, you can get them by info.object.your_trait
Then Return True (to close the window)

Thanks for your help
Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Boiteux, Benoit
Sent: Wednesday, January 20, 2010 10:06 AM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

Thanks !

close() method has only an info parameter that gives data on the UI.
How can we get access to Traits contained in the window we close ?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of bryce hendrix
Sent: Tuesday, January 19, 2010 5:49 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Pb with TableEditor

Boiteux, Benoit wrote:
> Thanks Didrik.
>
> There is something with Traits that is confusing: when you want to close a window.
> 1- If I create a view with an [OKButton], how can I get the event to perform actions before the window closes ?
>  

Define a handler as a subclass of Handler, overload the close() method,
then instantiate that handler in the View() call.

> 2- Or If I manually create a button like ok = Button('OK'), I get event with _ok_fired method, but how can I close the view from this handler?
>  

You would most likely need to do so from a handler, so I recommend
approach #1.

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev