<s> from ConfigParser import ConfigParser , RawConfigParser <EOL> import sys <EOL> import os <EOL> def get_password ( ) : <EOL> cf = ConfigParser ( ) <EOL> cf . read ( sys . argv [ <NUM_LIT:1> ] ) <EOL> password_path = cf . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> cf . read ( password_path ) <EOL> return cf . get ( '<STR_LIT:password>' , '<STR_LIT:password>' ) <EOL> def modify_password ( new_password ) : <EOL> cf = ConfigParser ( ) <EOL> cf . read ( sys . argv [ <NUM_LIT:1> ] ) <EOL> password_path = cf . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if os . path . exists ( password_path ) : <EOL> passwd_txt = ConfigParser ( ) <EOL> passwd_txt . read ( password_path ) <EOL> else : <EOL> passwd_txt = RawConfigParser ( ) <EOL> passwd_txt . add_section ( '<STR_LIT:password>' ) <EOL> passwd_txt . set ( '<STR_LIT:password>' , '<STR_LIT:password>' , new_password ) <EOL> with open ( password_path , '<STR_LIT:w>' ) as new_password : <EOL> passwd_txt . write ( new_password ) </s>
