refasandiego.blogg.se

Schedule creator 234
Schedule creator 234













_table_option = string return self def row_option ( self, string ): assert type ( string ) is str self. _matrix def table_option ( self, string ): assert type ( string ) is str self. _matrix = text return self def access ( self, row, column ): return self. _column_option = '' def mutate ( self, row, column, text ): assert type ( text ) is str self. execute ( main, 'cgi' ) # html_help.py # import time import Zam class html_table : def _init_ ( self, rows, columns, indent, style ): self. localtime ( mktime + 86400 ) return html + html_month. mktime ( now ) if start ' + description + ' \n ' + week ) now = time. column_option ( 'width="14%"' ) now_month = now. strftime ( '%B %Y', now ) + ' \n ' html_month = html_help. html () + ' \n ' if month != end_month : html += ' \t\t\t \n ' return html + ' \t\t \n\t \n ' def create_month_html ( description, start, end, week, month ): start = time.

schedule creator 234

mutate ( 0, 0, create_month_html ( description, start, end, week, month )). tm_mon - 1 ) for month in range ( start_month, end_month + 1 ): html += html_help. capitalize () + '.' ) def create_html ( description, start, end, week ): html = ''' \t \t\t \t\t\t The Schedule \t\t \t \t \t\t ''' start_month = start. tm_min except : raise WeekError ( 'Start time must come before end time on ' + key. capitalize () + ' should be in the HH:MM - HH:MM format.' ) try : assert second. split ( '-' ) assert len ( hm ) = 2 first = time. append ( values ) return unpacked def check_week ( dictionary, keys ): for key in keys : try : if not dictionary : continue hm = dictionary. print_html ( html ) def unpack ( values, keys ): unpacked = for key in keys : unpacked. mktime ( start ) except : show_form ( 'The end date must come after the start date.' ) try : check_week ( values, KEYS ) except WeekError, problem : show_form ( str ( problem )) html = create_html ( values, start, end, unpack ( values, KEYS )) Zcgi. strptime ( values, '%m/ %d /%y' ) except : show_form ( 'Dates must be in the MM/DD/YY format.' ) try : assert time. strptime ( values, '%m/ %d /%y' ) end = time. dictionary if not values : show_form ( 'You must enter a description.' ) try : start = time. has_key ( key ): return False return True def show_table (): values = Zcgi.

schedule creator 234 schedule creator 234

+ unpack ( values, KEYS ))) def has_keys ( dictionary, keys ): for key in keys : if not dictionary. print_html ( ''' \t \t\t \t\t\t Schedule Maker \t\t \t \t %s \t\t \t\t\t Description: \t\t\t \t\t\t Start Date: \t\t\t \t\t\t End Date: \t\t\t \t\t\t Sunday: \t\t\t \t\t\t Monday: \t\t\t \t\t\t Tuesday: \t\t\t \t\t\t Wednesday: \t\t\t \t\t\t Thursday: \t\t\t \t\t\t Friday: \t\t\t \t\t\t Saturday: \t\t\t \t\t\t \t\t \t ''' % tuple ()] \ dictionary, KEYS ): show_table () else : show_form () def show_form ( error = '' ): if error : error = ' \t\t ' + error + ' \n ' values = soft_dict ( Zcgi. dictionary is None : show_form () elif has_keys ( Zcgi. _string = string def _str_ ( self ): return self. _dictionary except : pass return '' class WeekError : def _init_ ( self, string ): self. _format = format def _getitem_ ( self, key ): try : if self. 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday' class soft_dict : def _init_ ( self, dictionary, format ): self. # index.py # import html_help import os import sys import time import Zcgi KEYS = 'description', 'start', 'end', 'sunday', 'monday', \















Schedule creator 234