def _output(self, workitem=None): if workitem is None: return False print( "{0:^30} | {1:^10} | {2:^45} | {3:^40}".format( workitem.id, workitem.status, workitem.title, workitem.task.title ) ) if len(workitem.timelog) > 0: for i in workitem.timelog: if i.stop is not None: print( "{0:>30} | {1:^10} | * {2:>20} / {3:>20} | {4}".format( "", "", convert_datetime_to_localtime(i.start).strftime("%Y-%m-%d %H:%M:%S"), convert_datetime_to_localtime(i.stop).strftime("%Y-%m-%d %H:%M:%S"), "", ) ) else: print( "{0:>30} | {1:^10} | * {2:>20} / {3:>20} | {4:40}".format( "", "", convert_datetime_to_localtime(i.start).strftime("%Y-%m-%d %H:%M:%S"), "ongoing", "" ) ) return True
def _long_output(self, format, task): print(format.format(task.counter, task.status, task.title, convert_datetime_to_localtime(task.created_at).strftime('%Y-%m-%d %H:%M:%S'), convert_datetime_to_localtime(task.updated_at).strftime('%Y-%m-%d %H:%M:%S')))
def _detail_output(self, format, task): print(format.format(task.counter, task.status, task.title, task.project.title, convert_datetime_to_localtime(task.created_at).strftime('%Y-%m-%d %H:%M:%S'), convert_datetime_to_localtime(task.updated_at).strftime('%Y-%m-%d %H:%M:%S'), ','.join([tag.tag for tag in task.tags])))
def _detail_output(self, format, task): print( format.format( task.counter, task.status, task.title, task.project.title, convert_datetime_to_localtime( task.created_at).strftime('%Y-%m-%d %H:%M:%S'), convert_datetime_to_localtime( task.updated_at).strftime('%Y-%m-%d %H:%M:%S'), ','.join([tag.tag for tag in task.tags])))
def _long_output(self, format, task): print( format.format( task.counter, task.status, task.title, convert_datetime_to_localtime( task.created_at).strftime('%Y-%m-%d %H:%M:%S'), convert_datetime_to_localtime( task.updated_at).strftime('%Y-%m-%d %H:%M:%S')))
def _output(self, task): title = 'Task: {0}\tProject: {1}'.format(task.title, task.project.title) headline = '{0:=<80}'.format('') counter = '\tID: {0} (UUID: {1})'.format(task.counter, task.id) status = '\tStatus: {0}'.format(task.status) created = '\tCreated At: {0}'.format(convert_datetime_to_localtime(task.created_at).strftime('%Y-%m-%d %H:%M:%S')) updated = '\tUpdated At: {0}'.format(convert_datetime_to_localtime(task.updated_at).strftime('%Y-%m-%d %H:%M:%S')) tags = '\tTags: {0}'.format(', '.join([tag.tag for tag in task.tags])) print(title) print(headline) print(counter) print(status) print(created) print(updated) print(tags)
def _output(self, task): title = 'Task: {0}\tProject: {1}'.format(task.title, task.project.title) headline = '{0:=<80}'.format('') counter = '\tID: {0} (UUID: {1})'.format(task.counter, task.id) status = '\tStatus: {0}'.format(task.status) created = '\tCreated At: {0}'.format( convert_datetime_to_localtime( task.created_at).strftime('%Y-%m-%d %H:%M:%S')) updated = '\tUpdated At: {0}'.format( convert_datetime_to_localtime( task.updated_at).strftime('%Y-%m-%d %H:%M:%S')) tags = '\tTags: {0}'.format(', '.join([tag.tag for tag in task.tags])) print(title) print(headline) print(counter) print(status) print(created) print(updated) print(tags)
def _output(self, workitem=None): if workitem is None: return False print('{0:^30} | {1:^10} | {2:^45} | {3:^40}'.format( workitem.id, workitem.status, workitem.title, workitem.task.title)) if len(workitem.timelog) > 0: for i in workitem.timelog: if i.stop is not None: print( '{0:>30} | {1:^10} | * {2:>20} / {3:>20} | {4}'.format( '', '', convert_datetime_to_localtime( i.start).strftime('%Y-%m-%d %H:%M:%S'), convert_datetime_to_localtime( i.stop).strftime('%Y-%m-%d %H:%M:%S'), '')) else: print('{0:>30} | {1:^10} | * {2:>20} / {3:>20} | {4:40}'. format( '', '', convert_datetime_to_localtime( i.start).strftime('%Y-%m-%d %H:%M:%S'), 'ongoing', '')) return True