def settings_to_cmd_args(settings_dict):
args = ['<STR_LIT>']<EOL>db = settings_dict['<STR_LIT>'].get('<STR_LIT>', settings_dict['<STR_LIT>'])<EOL>user = settings_dict['<STR_LIT>'].get('<STR_LIT:user>', settings_dict['<STR_LIT>'])<EOL>passwd = settings_dict['<STR_LIT>'].get('<STR_LIT>', settings_dict['<STR_LIT>'])<EOL>host = settings_dict['<STR_LIT>'].get('<STR_LIT:host>', settings_dict['<STR_LIT>'])<EOL>port = settings_dict['<STR_LIT>'].get('<STR_LIT:port>', settings_dict['<STR_LIT>'])<EOL>cert = settings_dict['<STR_LIT>'].get('<STR_LIT>', {}).get('<STR_LIT>')<EOL>defaults_file = settings_dict['<STR_LIT>'].get('<STR_LIT>')<EOL>if defaults_file:<EOL><INDENT>args += ["<STR_LIT>" % defaults_file]<EOL><DEDENT>if user:<EOL><INDENT>args += ["<STR_LIT>" % user]<EOL><DEDENT>if passwd:<EOL><INDENT>args += ["<STR_LIT>" % passwd]<EOL><DEDENT>if host:<EOL><INDENT>if '<STR_LIT:/>' in host:<EOL><INDENT>args += ["<STR_LIT>" % host]<EOL><DEDENT>else:<EOL><INDENT>args += ["<STR_LIT>" % host]<EOL><DEDENT><DEDENT>if port:<EOL><INDENT>args += ["<STR_LIT>" % port]<EOL><DEDENT>if cert:<EOL><INDENT>args += ["<STR_LIT>" % cert]<EOL><DEDENT>if db:<EOL><INDENT>args += [db]<EOL><DEDENT>return args<EOL>
Copied from django 1.8 MySQL backend DatabaseClient - where the runshell
commandline creation has been extracted and made callable like so.