예제 #1
0
 def __init__(self,metadata={}):
     self.metadata = metadata
     self.driver=PsqlGraphDriver(settings.METADATA_DB['HOST'],
         settings.METADATA_DB['USER'],settings.METADATA_DB['PASSWORD'],
         settings.METADATA_DB['NAME'])
     self.signpost = SignpostClient(settings.SIGNPOST_URL,version='v0')
예제 #2
0
osdc_prefix = 'osdc'

#does not support time zones -- for now leave it up to the submission scripts to put in UTC.
time_format = '%Y-%m-%d %H:%M:%S'

valid_keys = [
    'source', 'source_url', 'description', 'short_description', 'keyword',
    'size', 'modified', 'license', 'osdc_location', 'osdc_folder',
    'osdc_hs_location', 'osdc_hs_folder'
]

pg_driver = PsqlGraphDriver(METADATA_DB['HOST'], METADATA_DB['USER'],
                            METADATA_DB['PASSWORD'], METADATA_DB['NAME'])

signpost = SignpostClient(SIGNPOST_URL, version='v0')


def init_keys():
    for key in valid_keys:
        k = Key(key_name=key, public=True)
        k.save()


def add_dataset(title, prefix):
    key = str(uuid.uuid4())
    slug = slugify(title)

    d = DataSet(key=key, prefix=prefix, title=title, slug=slug)
    d.save()
예제 #3
0
 def from_configs(cls, signpost_client, boto_manager, **kwargs):
     return cls(signpost_client=SignpostClient(**signpost_client),
                boto_manager=BotoManager(**boto_manager),
                **kwargs)