1
0
mirror of https://github.com/djohnlewis/stackdump synced 2024-12-04 23:17:37 +00:00

Modified download_site_info script to create the data directory if it doesn't exist.

This commit is contained in:
Samuel Lai 2012-08-19 12:30:33 +10:00
parent c1ae870e3d
commit 16e5530a82

View File

@ -10,6 +10,10 @@ import sys
script_dir = os.path.dirname(sys.argv[0])
sites_file_path = os.path.join(script_dir, '../../../../data/sites')
# ensure the data directory exists
if not os.path.exists(os.path.dirname(sites_file_path)):
os.mkdir(os.path.dirname(sites_file_path))
# download the sites RSS file
print 'Downloading StackExchange sites RSS file...',
urllib.urlretrieve('http://stackexchange.com/feeds/sites', sites_file_path)