コード例 #1
0
ファイル: test_hkshell.py プロジェクト: attish/heapkeeper-old
 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
ファイル: hkrc_csabahoch.py プロジェクト: attish/heapkeeper_
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
ファイル: test_hkshell.py プロジェクト: attish/heapkeeper-old
 def test_save_listener__2(self):
     self._test_save(
         on=lambda: hkshell.on('save'),
         off=lambda: hkshell.off('save'))
コード例 #4
0
ファイル: test_hkshell.py プロジェクト: attish/heapkeeper-old
 def on_fun():
     self.assertEqual(hkshell.features()['gen_indices'], 'off')
     hkshell.on('gen_indices')
     self.assertEqual(hkshell.features()['gen_indices'], 'on')
コード例 #5
0
ファイル: hkrc_attis.py プロジェクト: attish/heapkeeper_
    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')