#NEWLINE# def main( ) : #NEWLINE# #INDENT# conn = r . connect ( ) #NEWLINE# try : #NEWLINE# #INDENT# r . db_create ( 'vim_awesome' ) . run ( conn ) #NEWLINE# #UNINDENT# except r . RqlRuntimeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# conn . use ( 'vim_awesome' ) #NEWLINE# db . init_db . ensure_tables_and_indices ( ) #NEWLINE# def read_file( filename ) : #NEWLINE# #INDENT# full_path = os . path . join ( os . path . dirname ( __file__ ) , filename ) #NEWLINE# with codecs . open ( full_path , encoding = 'utf-8' , mode = 'r' ) as f : #NEWLINE# #INDENT# return f . read ( ) #NEWLINE# #UNINDENT# #UNINDENT# ctrlp_readme = read_file ( 'ctrlp.md' ) #NEWLINE# youcompleteme_readme = read_file ( 'youcompleteme.md' ) #NEWLINE# db . plugins . insert ( [ { #NEWLINE# #INDENT# 'id' : 'ctrlp-example-plugin' , #NEWLINE# 'name' : 'ctrlp.vim' , #NEWLINE# 'github_url' : 'https://github.com/kien/ctrlp.vim' , #NEWLINE# 'vim_script_id' : 3736 , #NEWLINE# 'github_short_desc' : 'Fuzzy file, buffer, mru, tag, etc finder.' , #NEWLINE# 'github_readme' : ctrlp_readme , #NEWLINE# 'github_stars' : 2021 , #NEWLINE# 'homepage' : 'http://kien.github.io/ctrlp.vim/' , #NEWLINE# 'tags' : [ 'buffer' , 'file' , 'mru' , 'fuzzy' , 'finder' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 'youcompleteme-example-plugin' , #NEWLINE# 'name' : 'YouCompleteMe' , #NEWLINE# 'github_url' : 'https://github.com/Valloric/YouCompleteMe' , #NEWLINE# 'vim_script_id' : None , #NEWLINE# 'github_short_desc' : 'A code-completion engine for Vim' , #NEWLINE# 'github_readme' : youcompleteme_readme , #NEWLINE# 'github_stars' : 1723 , #NEWLINE# 'homepage' : 'http://valloric.github.io/YouCompleteMe/' , #NEWLINE# 'tags' : [ 'autocomplete' , 'fuzzy' , 'C' ] , #NEWLINE# #UNINDENT# } ] , conflict = 'replace' ) #NEWLINE# r . table ( 'tags' ) . insert ( [ { #NEWLINE# #INDENT# 'id' : 'buffer' , #NEWLINE# 'count' : 1 , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# tags . aggregate_tags ( )