def     get_census_data(stateFips): 
	if (stateFips<10) :
		stateFips = "0%s" % stateFips
        print 'Retrieving census shapefiles...'
        # put all data in publicmapping data directory
        olddir = os.getcwd()
        os.chdir("/projects/PublicMapping/data/")
        # obtain state boundary files from census
        cenBlockFilePrefix = 'tl_2010_%s_tabblock10' % stateFips
        cenTractFilePrefix = 'tl_2010_%s_tract10' % stateFips
        cenCountyFilePrefix= 'tl_2010_%s_county10' % stateFips
        cmdarg = 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/TABBLOCK/2010/%s.zip' % cenBlockFilePrefix 
        subprocess.check_call(["wget","-nc",cmdarg])
        cmdarg = 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/TRACT/2010/%s.zip' % cenTractFilePrefix
        subprocess.check_call(["wget","-N",cmdarg])
        cmdarg = 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/%s.zip' % cenCountyFilePrefix
        subprocess.check_call(["wget","-N",cmdarg])
        # get additional data from our S3 bucket
        print 'Retrieving additional data...'
        cmdarg = 'https://s3.amazonaws.com/redistricting_supplement_data/redist/%s_redist_data.zip' % stateFips
        subprocess.check_call(["wget","-N",cmdarg])
        cmdarg = 'https://s3.amazonaws.com/redistricting_supplement_data/redist/%s_contiguity_overrides.csv' % stateFips
        subprocess.call(["wget","-N",cmdarg])
        print 'Unzipping files ...'
        # unzip data files
        for i in [ cenBlockFilePrefix, cenTractFilePrefix, cenCountyFilePrefix ] :
	    	zfile = i % '%s.zip' 
		print ('Unzipping %s' %zfile)
                myzip = zipfile.ZipFile(zfile, 'r')
                myzip.extractall()
        myzip = zipfile.ZipFile('%s_redist_data.zip' % stateFips, 'r')
        myzip.extractall()        # Reproject block data
        print 'Reprojecting block shapefile...'
        if (os.path.exists("census_blocks.shp")) :
                os.remove('census_blocks.shp')
        if (os.path.exists("census_tracts.shp")) :
                os.remove('census_tracts.shp')
        if (os.path.exists("census_counties.shp")) :
                os.remove('census_counties.shp')
        subprocess.check_call(["ogr2ogr",'-overwrite','-t_srs','EPSG:3785','census_blocks.shp','%s.shp' % cenBlockFilePrefix ])
        subprocess.check_call(["ogr2ogr",'-overwrite','-t_srs','EPSG:3785','census_tracts.shp','%s.shp' % cenTractFilePrefix])
        subprocess.check_call(["ogr2ogr",'-overwrite','-t_srs','EPSG:3785','census_counties.shp','%s.shp' % cenCountyFilePrefix])
        # standardize file names
        print 'Copying data files...'
        shutil.copy('%s_redist_data.csv' %stateFips , 'redist_data.csv' )
        if (os.path.exists("redist_overrides.csv")) :
        	os.remove('redist_overrides.csv')
        if (os.path.exists("%s_contiguity_overrides.csv" % stateFips)) :
        	shutil.copy("%s_contiguity_overrides.csv" % stateFips,'redist_overrides.csv') 
        os.chdir(olddir)



###
### TEMPLATING  - SLD's
###

# general template classes
dataset/ETHPy150Open PublicMapping/DistrictBuilder/docs/loadcensus/configureCensus.py/get_census_data/swapped operands of `%`