<s> from io import StringIO <EOL> import json <EOL> import sys <EOL> from . base import Command <EOL> class Export ( Command ) : <EOL> """<STR_LIT>""" <EOL> name = "<STR_LIT>" <EOL> short_descr = "<STR_LIT>" <EOL> def run ( self , config , args ) : <EOL> concurrency = self . parse_concurrency ( args ) <EOL> if args [ '<STR_LIT>' ] == "<STR_LIT>" : <EOL> if not args [ '<STR_LIT>' ] : <EOL> print ( "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> try : <EOL> obj = config . procfile . as_dict ( args [ "<STR_LIT>" ] , concurrency ) <EOL> except KeyError : <EOL> raise KeyError ( "<STR_LIT>" % args [ "<STR_LIT>" ] ) <EOL> if args [ '<STR_LIT>' ] : <EOL> with open ( args [ '<STR_LIT>' ] , '<STR_LIT:w>' ) as f : <EOL> json . dump ( obj , f , indent = True ) <EOL> else : <EOL> print ( json . dumps ( obj , indent = True ) ) <EOL> else : <EOL> config = config . procfile . as_configparser ( concurrency ) <EOL> if args [ '<STR_LIT>' ] : <EOL> with open ( args [ '<STR_LIT>' ] , '<STR_LIT:w>' ) as f : <EOL> config . write ( f , space_around_delimiters = True ) <EOL> else : <EOL> buf = StringIO ( ) <EOL> config . write ( buf , space_around_delimiters = True ) <EOL> print ( buf . getvalue ( ) ) </s>
