~ubuntu-branches/ubuntu/trusty/python-traitsui/trusty

« back to all changes in this revision

Viewing changes to traitsui/editors/time_editor.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-07-09 13:57:39 UTC
  • Revision ID: james.westby@ubuntu.com-20110709135739-x5u20q86huissmn1
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#------------------------------------------------------------------------------
 
2
#
 
3
#  Copyright (c) 2008, Enthought, Inc.
 
4
#  All rights reserved.
 
5
#
 
6
#  This software is provided without warranty under the terms of the BSD
 
7
#  license included in enthought/LICENSE.txt and may be redistributed only
 
8
#  under the conditions described in the aforementioned license.  The license
 
9
#  is also available online at http://www.enthought.com/licenses/BSD.txt
 
10
#
 
11
#  Thanks for using Enthought open source!
 
12
#
 
13
#  Author: Judah De Paula
 
14
#  Date:   10/7/2008
 
15
#
 
16
#------------------------------------------------------------------------------
 
17
 
 
18
""" A Traits UI editor that wraps a WX timer control.
 
19
"""
 
20
 
 
21
from __future__ import absolute_import
 
22
 
 
23
from traits.api import Str
 
24
from ..editor_factory import EditorFactory
 
25
from ..ui_traits import AView
 
26
 
 
27
 
 
28
class TimeEditor(EditorFactory):
 
29
    """ Editor factory for time editors.  Generates _TimeEditor()s.
 
30
    """
 
31
 
 
32
    #---------------------------------------------------------------------------
 
33
    #  Trait definitions:
 
34
    #---------------------------------------------------------------------------
 
35
 
 
36
    #-- ReadonlyEditor traits --------------------------------------------------
 
37
 
 
38
    # Message to show when Time is None.
 
39
    message = Str('Undefined')
 
40
 
 
41
    # The string representation of the time to show.  Uses time.strftime format.
 
42
    strftime = Str('%I:%M:%S %p')
 
43
 
 
44
    # An optional view to display when a read-only text editor is clicked:
 
45
    view = AView