def list_all_sessions():
    if not len(tmux_dict.keys()):
        #name is empty, show all list(short info)
        l = util.all_backups()
        if not l or len(l) == 0:
            LOG.info("No backup was created yet.\nretmux -b [name] to create backup" )
            sys.exit()

        last = util.latest_backup().split('/')[-1]
        latest_tmux = util.get_tmux_by_id(last)
        #add into dict
        i=1
        tmux_dict[str(i)]=latest_tmux

        bk_list = [ b for b in l if b != last]
        for tmux_id in bk_list:
            tmux = util.get_tmux_by_id(tmux_id)
            i+=1
            tmux_dict[str(i)]=tmux

    list_fmt = '%s%2s %s'#fmt for list all, the first %s is the '*' place
    print util.get_line('=')
    #header
    print  list_fmt %(' ', 'No.',tmux_obj.Tmux.short_format%('Name','Sessions','Created on'))
    print util.get_line('=')
    keys = tmux_dict.keys()
    keys.sort()
    for idx in keys:
        tmux = tmux_dict[idx]
        latest_flag = '*' if idx == '1' else ' '
        print list_fmt%(latest_flag, idx, tmux.short_info())
    print util.get_line('-')
    print '%72s'%'Latest default backup with (*)'
print a list of all backuped sessions (with short info)
dataset/ETHPy150Open sk1418/retmux/tmuxbk/controller.py/list_all_sessions