Пример #1
0
 def __call__(self, args):
     super(WgNodeContentListCommand, self).__call__(args)
     endpoint = self.ls.workgroup_nodes
     parent = None
     if args.folders:
         parent = get_uuid_from(args.folders[-1])
     tbu = TableBuilder(self.ls, endpoint, self.IDENTIFIER)
     tbu.load_args(args)
     tbu.add_custom_cell("lastAuthor",
                         ComplexCellBuilder('{name} <{mail}>'))
     tbu.add_action(
         'download',
         DownloadAction(mode=self.CFG_DOWNLOAD_MODE,
                        parent_identifier=self.CFG_DOWNLOAD_ARG_ATTR))
     tbu.add_action(
         'delete',
         DeleteAction(mode=self.CFG_DELETE_MODE,
                      parent_identifier=self.CFG_DELETE_ARG_ATTR))
     tbu.add_filters(PartialOr(self.IDENTIFIER, args.names, True),
                     PartialDate("creationDate", args.cdate))
     json_obj = endpoint.list(args.wg_uuid,
                              parent,
                              flat=args.flat_mode,
                              node_types=args.node_types)
     tbu.add_pre_render_class(Breadcrumb())
     return tbu.build().load_v2(json_obj).render()
 def __call__(self, args):
     super(ListCommand, self).__call__(args)
     endpoint = self.ls.shared_spaces.members
     tbu = TableBuilder(self.ls, endpoint, self.IDENTIFIER)
     tbu.load_args(args)
     tbu.add_custom_cell(
         "role",
         ComplexCellBuilder(
             '{name}\n({uuid:.8})',
             '{name} ({uuid:})',
             '{name}',
         ))
     tbu.add_custom_cell(
         "account",
         ComplexCellBuilder('{name}\n({uuid:.8})',
                            '{name} <{mail}> ({uuid})'))
     tbu.add_custom_cell(
         "node", ComplexCellBuilder('{nodeType}: {name} ({uuid:.8})'))
     tbu.add_action(
         'delete',
         DeleteAction(mode=self.CFG_DELETE_MODE,
                      parent_identifier=self.CFG_DELETE_ARG_ATTR))
     tbu.add_filters(PartialOr(self.IDENTIFIER, args.names, True),
                     PartialOr(self.RESOURCE_IDENTIFIER, args.uuids, True),
                     PartialOr("role", args.roles, True, match_raw=False))
     return tbu.build().load_v2(endpoint.list(args.ss_uuid)).render()
Пример #3
0
 def __call__(self, args):
     super(DocumentsListCommand, self).__call__(args)
     endpoint = self.ls.documents
     tbu = TableBuilder(self.ls, endpoint, self.IDENTIFIER)
     tbu.load_args(args)
     tbu.add_action('share', ShareAction(self.api_version))
     tbu.add_filters(PartialOr(self.IDENTIFIER, args.names, True),
                     PartialDate("creationDate", args.cdate))
     return tbu.build().load_v2(endpoint.list()).render()
Пример #4
0
 def __call__(self, args):
     super(ListCommand, self).__call__(args)
     endpoint = self.ls.contactslistscontacts
     tbu = TableBuilder(self.ls, endpoint, self.IDENTIFIER)
     tbu.load_args(args)
     tbu.add_action(
         'delete',
         DeleteAction(mode=self.CFG_DELETE_MODE,
                      parent_identifier=self.CFG_DELETE_ARG_ATTR))
     tbu.add_filters(PartialOr(self.IDENTIFIER, args.pattern, True))
     json_obj = endpoint.list(args.mailing_list_uuid)
     return tbu.build().load_v2(json_obj).render()