<s> import os <EOL> try : <EOL> import configparser <EOL> except ImportError : <EOL> import ConfigParser as configparser <EOL> from . import appdirs <EOL> cwd = os . path . split ( os . path . abspath ( __file__ ) ) [ <NUM_LIT:0> ] <EOL> userdir = appdirs . user_data_dir ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> usercfg = os . path . join ( userdir , "<STR_LIT>" ) <EOL> config = configparser . ConfigParser ( ) <EOL> config . readfp ( open ( os . path . join ( cwd , '<STR_LIT>' ) ) ) <EOL> if len ( config . read ( usercfg ) ) == <NUM_LIT:0> : <EOL> os . makedirs ( userdir ) <EOL> with open ( usercfg , '<STR_LIT:w>' ) as fp : <EOL> config . write ( fp ) <EOL> if not config . has_option ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> config . set ( "<STR_LIT>" , "<STR_LIT>" , os . path . join ( cwd , os . pardir , "<STR_LIT>" ) ) <EOL> if not config . has_option ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> config . set ( "<STR_LIT>" , "<STR_LIT>" , os . path . join ( cwd , os . pardir , "<STR_LIT>" ) ) <EOL> if not config . has_section ( '<STR_LIT>' ) : <EOL> config . add_section ( '<STR_LIT>' ) <EOL> sulc = dict ( line_width = '<STR_LIT:2>' , <EOL> line_color = '<STR_LIT>' , <EOL> fill_color = '<STR_LIT>' , <EOL> shadow = '<STR_LIT:3>' , <EOL> labelsize = '<STR_LIT>' , <EOL> labelcolor = '<STR_LIT>' ) <EOL> for k , v in sulc . items ( ) : <EOL> config . set ( '<STR_LIT>' , k , v ) <EOL> del k , v <EOL> print ( '<STR_LIT>' ) <EOL> with open ( usercfg , '<STR_LIT:w>' ) as fp : <EOL> config . write ( fp ) </s>
