def export_shapefile():
    folder = 'shape'
    name = get_dataset_filename()
    
    # Create a shape folder in the temp directory if it does not exist
    temp_working_folder = os.path.join(temp_workspace,folder)
    create_folder(temp_working_folder, True)
    
    # Create a folder for the shapefile (put in in a folder to zip)
    zip_folder = os.path.join(temp_working_folder,name)
    create_folder(zip_folder)

    # Export the shapefile to the folder
    source = staging_feature_class
    destination = os.path.join(zip_folder,name + '.shp')
    
    # Export the shapefile
    logger.debug('Exporting to shapefile from "' + source + '" to "' + destination + '"')
    arcpy.CopyFeatures_management(source, destination, '', '0', '0', '0')
    
    # Zip up the files
    logger.debug('Zipping the shapefile')
    zip_file = zipfile.ZipFile(os.path.join(temp_working_folder,name + '.zip'), 'w')
    
    for filename in glob.glob(zip_folder + '/*'):
        zip_file.write(filename, os.path.basename(filename), zipfile.ZIP_DEFLATED)
        
    zip_file.close()
    
    # Publish the zipfile to the download folder
    publish_file(temp_working_folder, name + '.zip','shape')
Exports the feature class as a zipped shapefile
dataset/ETHPy150Open opencolorado/OpenColorado-Tools-and-Utilities/Scripts/ArcGIS/10.0/Python/PublishOpenDataset.py/export_shapefile