21 requests.packages.urllib3.disable_warnings() |
21 requests.packages.urllib3.disable_warnings() |
22 logger = logging.getLogger(__name__) |
22 logger = logging.getLogger(__name__) |
23 |
23 |
24 # The regex to find the measurement id from the measurement page |
24 # The regex to find the measurement id from the measurement page |
25 # This should be read from the uploaded file, but would require an extra NetCDF module. |
25 # This should be read from the uploaded file, but would require an extra NetCDF module. |
26 regex = "<h3>Measurement (?P<measurement_id>.{12}) <small>" |
26 regex = "<h3>Measurement (?P<measurement_id>.{12,15}) <small>" # {12, 15} to handle both old- and new-style measurement ids. |
27 |
27 |
28 |
28 |
29 class SCC: |
29 class SCC: |
30 """A simple class that will attempt to upload a file on the SCC server. |
30 """A simple class that will attempt to upload a file on the SCC server. |
31 |
31 |
712 subparsers = parser.add_subparsers() |
712 subparsers = parser.add_subparsers() |
713 |
713 |
714 delete_parser = subparsers.add_parser("delete", help="Deletes a measurement.") |
714 delete_parser = subparsers.add_parser("delete", help="Deletes a measurement.") |
715 rerun_all_parser = subparsers.add_parser("rerun-all", help="Reprocess a measurement on the SCC.") |
715 rerun_all_parser = subparsers.add_parser("rerun-all", help="Reprocess a measurement on the SCC.") |
716 rerun_processing_parser = subparsers.add_parser("rerun-processing", |
716 rerun_processing_parser = subparsers.add_parser("rerun-processing", |
717 help="Rerun processing routings for a measurement.") |
717 help="Rerun processing routines for a measurement.") |
718 process_file_parser = subparsers.add_parser("process-file", help="Upload a file and download procesing results.") |
718 process_file_parser = subparsers.add_parser("process-file", help="Upload a file and download processing results.") |
719 upload_file_parser = subparsers.add_parser("upload-file", help="Upload a file.") |
719 upload_file_parser = subparsers.add_parser("upload-file", help="Upload a file.") |
720 list_parser = subparsers.add_parser("list", help="List measurements registered on the SCC.") |
720 list_parser = subparsers.add_parser("list", help="List measurements registered on the SCC.") |
721 download_parser = subparsers.add_parser("download", help="Download selected measurements.") |
721 download_parser = subparsers.add_parser("download", help="Download selected measurements.") |
722 |
722 |
723 setup_delete(delete_parser) |
723 setup_delete(delete_parser) |