mirror of
https://github.com/djohnlewis/stackdump
synced 2025-04-07 02:03:27 +00:00
Modified download_site_info script to create the data directory if it doesn't exist.
This commit is contained in:
parent
c1ae870e3d
commit
16e5530a82
@ -10,6 +10,10 @@ import sys
|
|||||||
script_dir = os.path.dirname(sys.argv[0])
|
script_dir = os.path.dirname(sys.argv[0])
|
||||||
sites_file_path = os.path.join(script_dir, '../../../../data/sites')
|
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
|
# download the sites RSS file
|
||||||
print 'Downloading StackExchange sites RSS file...',
|
print 'Downloading StackExchange sites RSS file...',
|
||||||
urllib.urlretrieve('http://stackexchange.com/feeds/sites', sites_file_path)
|
urllib.urlretrieve('http://stackexchange.com/feeds/sites', sites_file_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user