Package gavo :: Package registry :: Module publication
[frames] | no frames]

Module publication

source code

"Publishing" service records -- grammar-type stuff and UI.

This module basically turns "publishable things" -- services, resource records, data items -- into row dictionaries that can be entered into the database.

This is one half of getting them into the registry. The other half is done in identifiers and builders; these take the stuff from the database, rebuilds actual objects and creates registry records from them. So, the content of the service table is not actually used to build resource records.

Classes
  RDRscRecIterator
A RowIterator yielding resource records for inclusion into the service list for the services defined in the source token RD.
  RDRscRecGrammar
A grammar for "parsing" raw resource records from RDs.
Functions
 
getManagedAuthorities(*args)
returns a (cached) set of authorities our main registry manages.
source code
 
makeBaseRecord(res, keepTimestamp=False)
returns a dictionary giving the metadata common to resource records.
source code
 
iterAuthorsAndSubjects(resource, sourceRD, resId)
yields rows for the subjects and authors tables.
source code
 
iterSvcRecs(service, keepTimestamp=False)
iterates over records suitable for importing into the service list for service.
source code
 
iterResRecs(res, keepTimestamp=False)
as iterSvcRecs, just for ResRecs rather than Services.
source code
 
iterDataRecs(res, keepTimestamp=False)
as iterSvcRecs, just for DataDescriptors rather than Services.
source code
 
getDeletedIdentifiersUpdater(conn, rd)
returns a function to be called after records have been updated to mark new deleted identifiers as changed.
source code
 
updateServiceList(rds, metaToo=False, connection=None, onlyWarn=True, keepTimestamp=False, unpublish=False)
updates the services defined in rds in the services table in the database.
source code
 
makeDeletedRecord(ivoid, conn)
enters records into the internal service tables to mark ivoid as deleted.
source code
 
findAllRDs()
returns ids of all RDs (inputs and built-in) known to the system.
source code
 
findPublishedRDs()
returns the ids of all RDs which have been published before.
source code
 
getRDs(args)
returns a list of RDs from a list of RD ids or paths.
source code
 
parseCommandLine() source code
 
updateRegistryTimestamp()
edits the dateupdated field for the registry service in servicelist.
source code
 
main()
handles the user interaction for gavo publish.
source code
Variables
  HIDDEN_RENDERERS = frozenset(['availability', 'capabilities', ...
  __package__ = 'gavo.registry'
Function Details

getManagedAuthorities(*args)

source code 

returns a (cached) set of authorities our main registry manages.

Decorators:
  • @utils.memoized

iterAuthorsAndSubjects(resource, sourceRD, resId)

source code 

yields rows for the subjects and authors tables.

resource is the meta-carrier for the resource to be described, sourceRD and resId are its keys in the resources table.

getDeletedIdentifiersUpdater(conn, rd)

source code 

returns a function to be called after records have been updated to mark new deleted identifiers as changed.

The problem solved here is that we mark all resource metadata belonging to and RD as deleted before feeding the new stuff in. We don't want to change resources.rectimestamp there; this would, for instance, bump old deleted records.

What we can do is see if there's new deleted records after and rd is through and update their rectimestamp. We don't need to like it.

updateServiceList(rds, metaToo=False, connection=None, onlyWarn=True, keepTimestamp=False, unpublish=False)

source code 

updates the services defined in rds in the services table in the database.

This is what actually does the publication.


Variables Details

HIDDEN_RENDERERS

Value:
frozenset(['availability', 'capabilities', 'tableMetadata'])