def run_properties(self): """Lists the system's properties (Milestone, Component, etc.). usage: cm properties """ properties = self._get_properties() print(ui.title("Milestones")) print(", ".join(properties["milestone"]["options"]) + "\n") print(ui.title("Components")) print(", ".join(properties["component"]["options"]) + "\n") print(ui.title("Status")) print(", ".join(properties["status"]["options"]) + "\n")
def print_function_help(self, attrname): """Print the docstring for one function. :param attrname: Name of the function, with the run_ prefix. """ func_name = attrname[4:] print(ui.title(func_name)) print(getattr(self, attrname).__doc__)
def add_new_note(list): title = ui.title('Wprowadz tytul notatki: ') note = ui.note('Wprowadz notatke: ') print('Wprowadz dzien') day = int(input()) print('Wprowadz miesiac') month = int(input()) print('Wprowadz rok') year = int(input()) dat = datetime.date(year, month, day) while True: new_note = (day, month, year, title, note) list.append(new_note) storage.export_data_to(list, 'notes.txt') break
def run_view(self, ticket_id): """Display a ticket summary. usage: cm view ticket_id """ ticket_id = text.validate_id(ticket_id) query_string = "/ticket/%d?format=tab" % ticket_id t = self.get_tickets(query_string).next() title = t.format_title() print(ui.title(title)) print("") print(t.description)
def add_new_meeting_to(meeting_list): title = ui.title('Enter meeting title: ') duration = ui.duration('Enter duration in hours (1 or 2): ') while True: start_time = ui.start_time('Enter start time: ') if operations.check_meeting_in_working_hours(duration, start_time): end_time = start_time + duration if operations.check_meeting_overlpas(start_time, end_time, meeting_list): new_meeting = (start_time, end_time, title) meeting_list.append(new_meeting) storage.export_data_to(meeting_list, 'meetings.txt') break else: ui.display_error_message( 'Meeting overlaps with existing meeting!') else: ui.display_error_message( 'Meeting is outside of your working hours (8 to 18)!')
def remove_note(list): title = ui.title('Wprowadz tytul notatki: ') ui.remove(list, title) ui.display_message(ui.GREEN, 'Notatka zostala usunieta')