Exemplo n.º 1
0
Arquivo: login.py Projeto: pnw/jiggl
    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
Exemplo n.º 2
0
Arquivo: basic.py Projeto: pnw/jiggl
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
Arquivo: login.py Projeto: pnw/jiggl
    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
Exemplo n.º 5
0
Arquivo: login.py Projeto: pnw/jiggl
    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
Exemplo n.º 6
0
Arquivo: login.py Projeto: pnw/jiggl
    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
Exemplo n.º 7
0
def print_error_group((err, entries)):
    print
    print bcolors.bold(bcolors.underline(err))
    print '\n'.join(map(str, [e.get('description', e['id']) for e in entries]))
    print
Exemplo n.º 8
0
def print_total_for_day(entries):
    print '-------'
    print(bcolors.bold('%-8s') +
          ' Total Time to log for day') % (sum_as_timedelta(entries))
Exemplo n.º 9
0
Arquivo: login.py Projeto: pnw/jiggl
 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)
Exemplo n.º 10
0
Arquivo: login.py Projeto: pnw/jiggl
 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)
Exemplo n.º 11
0
Arquivo: basic.py Projeto: pnw/jiggl
def print_error_group((err, entries)):
    print
    print bcolors.bold(bcolors.underline(err))
    print "\n".join(map(str, [e.get("description", e["id"]) for e in entries]))
    print
Exemplo n.º 12
0
Arquivo: basic.py Projeto: pnw/jiggl
def print_total_for_day(entries):
    print "-------"
    print (bcolors.bold("%-8s") + " Total Time to log for day") % (sum_as_timedelta(entries))