<s> import os . path <EOL> from sfmigration . common . softwarefactory import SFRedmineMigrator <EOL> from sfmigration . common import utils <EOL> from sfmigration . issues . github import GithubImporter <EOL> logger = utils . logger <EOL> def get_values ( config_file = '<STR_LIT>' ) : <EOL> if not os . path . isfile ( config_file ) : <EOL> logger . error ( "<STR_LIT>" ) <EOL> raise <EOL> source_github = { '<STR_LIT:username>' : '<STR_LIT>' , <EOL> '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> for key in source_github . iterkeys ( ) : <EOL> source_github [ key ] = utils . get_config_value ( config_file , <EOL> '<STR_LIT>' , key ) <EOL> dest_redmine = { '<STR_LIT:username>' : '<STR_LIT>' , '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT:id>' : '<STR_LIT>' , '<STR_LIT:url>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] } <EOL> for key in dest_redmine . iterkeys ( ) : <EOL> dest_redmine [ key ] = utils . get_config_value ( config_file , <EOL> '<STR_LIT>' , key ) <EOL> if dest_redmine [ '<STR_LIT:url>' ] . endswith ( '<STR_LIT:/>' ) : <EOL> dest_redmine [ '<STR_LIT:url>' ] = dest_redmine [ '<STR_LIT:url>' ] [ : - <NUM_LIT:1> ] <EOL> versions_to_skip = utils . get_config_value ( config_file , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> if versions_to_skip : <EOL> dest_redmine [ '<STR_LIT>' ] = versions_to_skip . split ( '<STR_LIT:U+002C>' ) <EOL> issues_to_skip = utils . get_config_value ( config_file , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> if issues_to_skip : <EOL> dest_redmine [ '<STR_LIT>' ] = issues_to_skip . split ( '<STR_LIT:U+002C>' ) <EOL> dest_redmine [ '<STR_LIT>' ] = utils . ConfigMapper ( '<STR_LIT>' ) <EOL> return source_github , dest_redmine <EOL> def main ( config_file = '<STR_LIT>' ) : <EOL> source_github , dest_redmine = get_values ( ) <EOL> source = GithubImporter ( ** source_github ) <EOL> target = SFRedmineMigrator ( ** dest_redmine ) <EOL> target . migrate ( source ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
