improve ls command in handjoob
This commit is contained in:
parent
86f5444cab
commit
b4c93587b4
10 changed files with 54 additions and 71 deletions
|
|
@ -84,6 +84,7 @@ class Handjoob(ReplApplication):
|
|||
'job_advert': JobAdvertFormatter,
|
||||
}
|
||||
COMMANDS_FORMATTERS = {'search': 'job_advert_list',
|
||||
'ls': 'job_advert_list',
|
||||
'info': 'job_advert',
|
||||
}
|
||||
|
||||
|
|
@ -99,6 +100,17 @@ class Handjoob(ReplApplication):
|
|||
for backend, job_advert in self.do('search_job', pattern):
|
||||
self.cached_format(job_advert)
|
||||
|
||||
@defaultcount(10)
|
||||
def do_ls(self, line):
|
||||
"""
|
||||
advanced search
|
||||
|
||||
Search for an advert matching to advanced filters.
|
||||
"""
|
||||
self.change_path([u'advanced'])
|
||||
for backend, job_advert in self.do('advanced_search_job'):
|
||||
self.cached_format(job_advert)
|
||||
|
||||
def complete_info(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
if len(args) == 2:
|
||||
|
|
|
|||
|
|
@ -81,6 +81,13 @@ class ICapJob(IBaseCap):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def advanced_search_job(self):
|
||||
"""
|
||||
Iter results of an advanced search
|
||||
|
||||
:rtype: iter[:class:`BaseJobAdvert`]
|
||||
"""
|
||||
|
||||
def get_job_advert(self, _id, advert=None):
|
||||
"""
|
||||
Get an announce from an ID.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue