<s> from atom . api import Typed <EOL> from enaml . widgets . datetime_selector import ProxyDatetimeSelector <EOL> from . QtGui import QDateTimeEdit <EOL> from . qt_bounded_datetime import QtBoundedDatetime , CHANGED_GUARD <EOL> class QtDatetimeSelector ( QtBoundedDatetime , ProxyDatetimeSelector ) : <EOL> """<STR_LIT>""" <EOL> widget = Typed ( QDateTimeEdit ) <EOL> def create_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> self . widget = QDateTimeEdit ( self . parent_widget ( ) ) <EOL> def init_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( QtDatetimeSelector , self ) . init_widget ( ) <EOL> d = self . declaration <EOL> self . set_datetime_format ( d . datetime_format ) <EOL> self . set_calendar_popup ( d . calendar_popup ) <EOL> self . widget . dateTimeChanged . connect ( self . on_datetime_changed ) <EOL> def get_datetime ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . widget . dateTime ( ) . toPython ( ) <EOL> def set_minimum ( self , datetime ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setMinimumDateTime ( datetime ) <EOL> def set_maximum ( self , datetime ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setMaximumDateTime ( datetime ) <EOL> def set_datetime ( self , datetime ) : <EOL> """<STR_LIT>""" <EOL> self . _guard |= CHANGED_GUARD <EOL> try : <EOL> self . widget . setDateTime ( datetime ) <EOL> finally : <EOL> self . _guard &= ~ CHANGED_GUARD <EOL> def set_datetime_format ( self , format ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setDisplayFormat ( format ) <EOL> def set_calendar_popup ( self , popup ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setCalendarPopup ( popup ) </s>
