Skip to content

Instantly share code, notes, and snippets.

@anxiousmodernman
Created September 5, 2014 19:58
Show Gist options
  • Save anxiousmodernman/10e5f7d5e0c2601079ac to your computer and use it in GitHub Desktop.
Save anxiousmodernman/10e5f7d5e0c2601079ac to your computer and use it in GitHub Desktop.
If I have multiple project roots I can update them all by simply changing the SOURCE variable at the top of my config.py
"""
Set this to the current project you're working on.
"""
SOURCE = 'MLSListings_new'
if SOURCE == 'GEPAR':
PROJECT_ROOT = 'C:\\Users\\cmcfarland\\Dropbox\\Homesnap\\Projects\\GEPAR\\'
sqlfile = PROJECT_ROOT + 'insert_template.sql'
mappingfile = PROJECT_ROOT + 'fields_added.csv'
if SOURCE == 'MLSListings_new':
PROJECT_ROOT = 'C:\\Users\\cmcfarland\\Dropbox\\Homesnap\\Projects\\MLSListings_new\\'
sqlfile = PROJECT_ROOT + 'insert_template.sql'
mappingfile = PROJECT_ROOT + 'fields_added.csv'
@anxiousmodernman
Copy link
Author

Remember, when you import config.py, python will run the whole file, so the if statements will be evaluated, and the configs will be set correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment