Пример #1
0
 def on_fun():
     self.assertEqual(
         hkshell.features()['touched_post_printer'],
         'off')
     hkshell.on('touched_post_printer')
     self.assertEqual(
         hkshell.features()['touched_post_printer'],
         'on')
Пример #2
0
def main():
    hkshell.options.callbacks.gen_indices = gen_indices
    hkshell.options.callbacks.gen_posts = gen_posts
    hkshell.options.callbacks.edit_file = edit_file
    hkshell.options.save_on_ctrl_d = False
    hkshell.on('tpp')
    hkshell.on('s')
    hkshell.on('gi')
    hkshell.on('gp')
Пример #3
0
 def test_save_listener__2(self):
     self._test_save(
         on=lambda: hkshell.on('save'),
         off=lambda: hkshell.off('save'))
Пример #4
0
 def on_fun():
     self.assertEqual(hkshell.features()['gen_indices'], 'off')
     hkshell.on('gen_indices')
     self.assertEqual(hkshell.features()['gen_indices'], 'on')
Пример #5
0
    date_fun = hkcustomlib.create_date_fun(date_options)

    genopts = hklib.GeneratorOptions()
    genopts.postdb = postdb
    genopts.write_toc = True
    genopts.print_thread_of_post = True
    genopts.date_fun = date_fun

    # Generating the posts
    hklib.Generator(postdb).gen_posts(genopts, posts)

@hkshell.hkshell_cmd()
def et(pps):
    """Tidy up a whole thread."""
    roots = []
    for post in hklib.PostSet(hkshell.postdb(), pps):
        roots.append(hkshell.postdb().root(post))
    for root in roots:
        for post in hkshell.postdb().iter_thread(root):
            hkshell.e(post.heapid())
    hkshell.ga()

@hkshell.hkshell_cmd()
def lsr(heapid):
    """Print a whole thread, ie. recursive ls."""
    hkshell.ls(hkshell.ps(heapid).exp())

hkshell.options.callbacks.gen_indices = gen_indices
hkshell.options.callbacks.gen_posts = gen_posts
hkshell.on('save')