#NEWLINE# def do_load( self , line ) : #NEWLINE# #INDENT# 'Load a backup based on its number per `list`..\n        ' #NEWLINE# try : #NEWLINE# #INDENT# i = int ( i ) #NEWLINE# filename = self . get_filenames ( ) [ i ] #NEWLINE# #UNINDENT# except ( ValueError , KeyError ) : #NEWLINE# #INDENT# print ( '\x1b[31;1mBad backup number!\x1b[0m' ) #NEWLINE# print ( '\x1b[32;1mPick one of these:\x1b[0m' ) #NEWLINE# self . do_list ( '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( subprocess . call ( [ 'dropdb' , self . dbname ] ) == 0 ) : #NEWLINE# #INDENT# if ( subprocess . call ( [ 'createdb' , self . dbname ] ) == 0 ) : #NEWLINE# #INDENT# subprocess . call ( 'psql {} < {}/{}' . format ( self . dbname , self . root , filename ) , shell = True )