Example #1
0
    def handle_proj(self, p, options, args, proj):

        if not proj.me:
            print("Sorry, I don't know who you are.")
            print("Use pitz-me to add yourself to the project.")
            raise SystemExit

        if proj.me.my_todo:

            results = self.apply_filter_and_grep(
                p, options, args, proj.me.my_todo)

            if options.limit:
                results = results[:options.limit]

            clepy.send_through_pager(

                results.custom_view(
                    options.custom_view or 'summarized_view',

                    self.figure_out_colorization(options.color,
                        proj.me.use_colorization)),

                clepy.figure_out_pager(os.environ))

        else:
            print("I didn't find any tasks for you (%(title)s)."
                % proj.me)
Example #2
0
    def handle_proj(self, p, options, args, proj):

        results = self.apply_filter_and_grep(
            p, options, args, proj.recent_activity)

        if options.limit:
            results = results[:options.limit]

        clepy.send_through_pager(results.custom_view(
            options.custom_view or 'summarized_view'),
            clepy.figure_out_pager(os.environ))
Example #3
0
    def handle_proj(self, p, options, args, proj):

        e = proj[args[0]]

        if isinstance(e, Entity):

            clepy.send_through_pager(
                e.custom_view(
                    options.custom_view or 'detailed_view',

                    color=self.figure_out_colorization(
                        options.color,
                        proj.me.use_colorization)),

                clepy.figure_out_pager(os.environ))

        else:
            print("Sorry, couldn't find %s" % args[0])
Example #4
0
    def handle_proj(self, p, options, args, proj):

        results = self.apply_filter_and_grep(p, options, args, proj)

        if self.filter:
            results = results(**self.filter)

        if options.limit:
            results = results[:options.limit]

        if self.title:
            results.title = "%s: %s" % (proj.title, self.title)

        clepy.send_through_pager(
            results.custom_view(
                options.custom_view or 'summarized_view',

                self.figure_out_colorization(options.color,
                    proj.me.use_colorization if proj.me else None)),

            clepy.figure_out_pager(os.environ))
Example #5
0
def _print_ids(sfdc,release,status,reverse,order=None,owner_list=None,grep=None):

    """
    Prints the ids associated with the get_ids method call for these params.

    See: get_ids.
    """

    print_me = ""
    for el in get_ids(sfdc,release,status,reverse,order,owner_list,grep):

        subject = el[1]
        if (el[1] is not None) and (len(el[1]) > 40):
                subject = el[1]

        print_me += "%s%s%s %-8s %-10s %-20s%s%-25s%s   %s\n\n" % (bcolors.BOLDGREEN,el[0],bcolors.ENDC,
                                                 el[3],
                                                 el[5],
                                                 el[4],
                                                 bcolors.UNDERLINE,el[2],bcolors.ENDC,
                                                 subject)
    clepy.send_through_pager(print_me,clepy.figure_out_pager())
Example #6
0
    def handle_proj(self, p, options, args, proj):

        results = self.apply_filter_and_grep(p, options, args, proj.todo)

        if options.by_owner:

            results = results.order(pitz.by_whatever('xxx',
                'owner', 'milestone', 'status', 'pscore'))

            # I have to wait to apply the limit until AFTER I sorted the
            # bag.
            if options.limit:
                results = results[:options.limit]

            clepy.send_through_pager(
                results.colorized_by_owner_view

                if self.figure_out_colorization(options.color,
                    proj.me.use_colorization)

                else results.by_owner_view,
                clepy.figure_out_pager(os.environ))

        else:

            if options.limit:
                results = results[:options.limit]

            clepy.send_through_pager(
                results.custom_view(
                    options.custom_view or 'summarized_view',

                    self.figure_out_colorization(
                        options.color,
                        proj.me.use_colorization if proj.me else None)),

                clepy.figure_out_pager(os.environ))
Example #7
0
    elif prime_command == 'get-comments':

        order = command_dict.get('order-by',None)
        reverse = command_dict.get('reverse',False)
        grep = command_dict.get('grep',None)

        if order in ('Date','date','Created','created','CreatedDate'):
            order = 'CreatedDate'

        print_me = ""
        for el in case_comments(sfdc,case_number,order,reverse,grep):
            print_me += """
%s%s%s : %s
%s
""" % (bcolors.OKGREEN,el[0],bcolors.ENDC,el[1],el[2])
        clepy.send_through_pager(print_me,clepy.figure_out_pager())

    elif prime_command == 'create':

        subject = command_dict.get('create')
        owner = command_dict.get('owner')
        release = command_dict.get('release')
        description = command_dict.get('description')
        status = command_dict.get('status')
        priority = command_dict.get('priority')
        type = command_dict.get('type')

        case_dict = {}

        if owner:
            owner_str = owner[0]