<s> import os . path <EOL> from ... client import Server <EOL> from ... designer import pushapps <EOL> from ... schema import Document <EOL> def init_from_config ( config ) : <EOL> """<STR_LIT>""" <EOL> uri = config [ '<STR_LIT>' ] <EOL> dbname = config [ '<STR_LIT>' ] <EOL> config [ '<STR_LIT>' ] = init_db ( uri , dbname ) <EOL> config [ '<STR_LIT>' ] = os . path . join ( config [ '<STR_LIT>' ] [ '<STR_LIT:root>' ] , "<STR_LIT>" ) <EOL> def init_db ( uri , dbname , main_db = True ) : <EOL> """<STR_LIT>""" <EOL> server = Server ( uri ) <EOL> db = server . get_or_create_db ( dbname ) <EOL> if main_db : <EOL> Document . set_db ( db ) <EOL> return db <EOL> def sync_design ( db , path ) : <EOL> """<STR_LIT>""" <EOL> pushapps ( path , db ) <EOL> def default_design_path ( config ) : <EOL> """<STR_LIT>""" <EOL> return os . path . join ( config [ '<STR_LIT>' ] [ '<STR_LIT:root>' ] , "<STR_LIT>" ) </s>
