def print_jira_preflight(tce): start, duration = z.get(['start', 'duration'], tce.entry) print bcolors.header('Adding Jira worklog:'), \ 'start(%s)' % bcolors.okblue(start.split('T')[-1].split('+')[0]), \ 'duration(%s)' % bcolors.okblue(timedelta(seconds=duration)), print bcolors.okblue(tce.ticket), tce.comment, print '...',
def procure_jira(self): print bcolors.header('\n\nJira\n') print 'To update your Jira tickets, I\'ll need three things:\n' print '1. Url (e.g. ' + bcolors.bold('http://jira.atlassian.net') + ')' print '2. Username ' + bcolors.warning('Note: Your Jira email will not work. You must provide your username.') print '3. Password\n' if self.jira_url: jira_url = raw_input('Jira Url (enter to use existing): ') else: jira_url = None while not jira_url: jira_url = raw_input('Jira Url; e.g. http://jira.atlassian.net: ') if jira_url: self.jira_url = jira_url if self.jira_username: jira_username = raw_input('Jira Username (enter to use existing): ') else: jira_username = None while not jira_username: jira_username = raw_input('Jira Username: '******'Jira Password (enter to use existing): ') else: jira_password = None while not jira_password: jira_password = raw_input('Jira Password: ') if jira_password: self.jira_password = jira_password
def print_jira_preflight(tce): start, duration = z.get(["start", "duration"], tce.entry) print bcolors.header("Adding Jira worklog:"), "start(%s)" % bcolors.okblue( start.split("T")[-1].split("+")[0] ), "duration(%s)" % bcolors.okblue(timedelta(seconds=duration)), print bcolors.okblue(tce.ticket), tce.comment, print "...",
def print_valid_entries(entries): print bcolors.header(bcolors.underline("\nLogging to Jira\n")) # entries = map(get_val, entries) groups = z.groupby(z.get("description", default=""), entries) cleaned = map(split_description, groups.iteritems()) for (issue, comment), es in cleaned: print (bcolors.bold("%-8s") + " %s") % (sum_as_timedelta(es), bcolors.okblue(issue) + " " + comment)
def print_valid_entries(entries): print bcolors.header(bcolors.underline('\nLogging to Jira\n')) # entries = map(get_val, entries) groups = z.groupby(z.get('description', default=''), entries) cleaned = map(split_description, groups.iteritems()) for (issue, comment), es in cleaned: print(bcolors.bold('%-8s') + ' %s') % ( sum_as_timedelta(es), bcolors.okblue(issue) + ' ' + comment)
def procure_toggl(self): print bcolors.header('\n\nToggl\n') print 'To read your Toggl feed, I just need an API token.\n' \ 'Your Toggl API token can be found at ' \ 'the bottom of your profile page:' \ '\n\n' + bcolors.bold('https://www.toggl.com/app/profile') + '\n\n' if self.toggl_api_token: toggl_token = raw_input('Toggl token (enter to use existing): ') else: toggl_token = None while not toggl_token: toggl_token = raw_input('Toggl token: ') if toggl_token: self.toggl_api_token = toggl_token
def procure_jira(self): print bcolors.header('\n\nJira\n') print 'To update your Jira tickets, I\'ll need three things:\n' print '1. Url (e.g. ' + bcolors.bold('http://jira.atlassian.net') + ')' print '2. Username ' + bcolors.warning( 'Note: Your Jira email will not work. You must provide your username.' ) print '3. Password\n' if self.jira_url: jira_url = raw_input('Jira Url (enter to use existing): ') else: jira_url = None while not jira_url: jira_url = raw_input( 'Jira Url; e.g. http://jira.atlassian.net: ') if jira_url: self.jira_url = jira_url if self.jira_username: jira_username = raw_input( 'Jira Username (enter to use existing): ') else: jira_username = None while not jira_username: jira_username = raw_input('Jira Username: '******'Jira Password (enter to use existing): ') else: jira_password = None while not jira_password: jira_password = raw_input('Jira Password: ') if jira_password: self.jira_password = jira_password
def say_goodbye(self): print bcolors.header('\nDone!')
def say_hi(self): clear_screen() print bcolors.header('Welcome to Jiggl!\n') print 'To use Jiggl, I\'ll need your credentials to both Jiggl and Toggl.\n' \ 'Your credentials will be stored in the file ' \ 'located at:\n\n' + bcolors.bold(settings_filepath)