# Acquires data sources _config = CWRConfiguration() """ Publisher patterns. """ publisher = field_special.lineStart + field_record.record_prefix(_config.record_type('publisher'), compulsory=True) + field_publisher.publisher_sequence_n + \ field_special.ip_n() + field_publisher.name + field_publisher.unknown + \ field_table.publisher_type() + field_publisher.tax_id + field_special.ipi_name_number() + field_publisher.submitter_agreement_n + \ society.pr_affiliation() + society.pr_share(maximum=50) + \ society.mr_affiliation() + society.mr_share() + \ society.sr_affiliation() + society.sr_share() + \ field_table.special_agreement() + field_publisher.first_recording_refusal + field_special.blank( 1) + field_special.ipi_base_number() + field_publisher.international_code + \ field_publisher.society_assigned_agreement_n + field_table.agreement_type() + field_table.usa_license() + field_special.lineEnd """ Parsing actions for the patterns. """ publisher.setParseAction(lambda p: _to_publisherrecord(p)) """ Parsing methods. These are the methods which transform nodes into instances of classes. """
def setUp(self): self.ipi = special.ipi_base_number(compulsory=True)
nwn = field_special.lineStart + field_record.record_prefix( _config.record_type( 'nwn'), compulsory=True) + field_special.ip_n() + field_nra.writer_last_name + field_nra.writer_first_name + \ field_table.language_code() + field_special.lineEnd nat = field_special.lineStart + field_record.record_prefix( _config.record_type( 'nat'), compulsory=True) + field_nra.nat_title + field_table.title_type() + field_table.language_code() + field_special.lineEnd npr = field_special.lineStart + field_record.record_prefix( _config.record_type( 'npr'), compulsory=True) + field_nra.performing_artist_name + field_nra.performing_artist_first_name + field_special.ipi_name_number() + \ field_special.ipi_base_number() + field_table.language_code() + field_nra.performance_language + field_nra.dialect + field_special.lineEnd nra_work = field_special.lineStart + field_record.record_prefix( _config.record_type('nra_work'), compulsory=True) + field_nra.title + field_table.language_code() + field_special.lineEnd now = field_special.lineStart + field_record.record_prefix( _config.record_type( 'now'), compulsory=True) + field_nra.writer_name + field_nra.writer_first_name_now + field_table.language_code() + field_nra.writer_position + field_special.lineEnd """ Parsing actions for the patterns. """ npa.setParseAction(lambda a: _to_npa(a))
_config = CWRConfiguration() """ Patterns. """ writer = field_special.lineStart + field_record.record_prefix( _config.record_type('writer'), compulsory=True) + field_special.ip_n() + field_writer.writer_last_name + field_writer.writer_first_name + field_writer.unknown + \ field_table.writer_designation() + field_publisher.tax_id + field_special.ipi_name_number() + \ field_society.pr_affiliation() + field_society.pr_share() + \ field_society.mr_affiliation() + field_society.mr_share() + \ field_society.sr_affiliation() + field_society.sr_share() + \ field_writer.reversionary + field_writer.first_recording_refusal + field_writer.for_hire + field_special.blank( _config.field_size('writer', 'filler')) + \ field_special.ipi_base_number() + field_writer.personal_number + field_table.usa_license() + field_special.lineEnd """ Parsing actions for the patterns. """ writer.setParseAction(lambda p: _to_writerrecord(p)) """ Parsing methods. These are the methods which transform nodes into instances of classes. """ def _to_writer(parsed):
def setUp(self): self.ipi = special.ipi_base_number()
def get_field(self, name=None, columns=None, values=None): return special.ipi_base_number(name)
field_work_detail.entire_work_title + field_work_detail.iswc + field_table.language_code() + field_work_detail.writer_1_last_name + \ field_work_detail.writer_1_first_name + field_work_detail.source + field_work_detail.writer_1_ipi_name_n + \ field_work_detail.writer_1_ipi_base_n + field_work_detail.writer_2_last_name + \ field_work_detail.writer_2_first_name + field_work_detail.writer_2_ipi_name_n + field_work_detail.writer_2_ipi_base_n + field_work.submitter_work_n + field_special.lineEnd version = field_special.lineStart + field_record.record_prefix(_config.record_type('original_work_title'), compulsory=True) + \ field_work_detail.original_title + field_work_detail.iswc + field_table.language_code() + field_work_detail.writer_1_last_name + \ field_work_detail.writer_1_first_name + field_work_detail.source + field_work_detail.writer_1_ipi_name_n + \ field_work_detail.writer_1_ipi_base_n + field_work_detail.writer_2_last_name + \ field_work_detail.writer_2_first_name + field_work_detail.writer_2_ipi_name_n + field_work_detail.writer_2_ipi_base_n + field_work.submitter_work_n + field_special.lineEnd performing = field_special.lineStart + field_record.record_prefix(_config.record_type('performing_artist'), compulsory=True) + \ field_work_detail.performing_artist_last_name + field_work_detail.performing_artist_first_name + field_special.ipi_name_number() + \ field_special.ipi_base_number() + field_special.lineEnd recording = field_special.lineStart + field_record.record_prefix(_config.record_type('recording_detail'), compulsory=True) + field_work_detail.first_release + \ field_special.blank(_config.field_size('recording_detail', 'constant_1')) + \ field_work_detail.first_release_duration + field_special.blank( _config.field_size('recording_detail', 'constant_2')) + \ field_work_detail.first_title + field_work_detail.first_label + field_work_detail.first_release_catalog_n + \ field_special.ean_13() + field_special.isrc() + field_table.recording_formats() + \ field_table.recording_techniques() + field_table.media_types() + field_special.lineEnd origin = field_special.lineStart + field_record.record_prefix(_config.record_type('work_origin'), compulsory=True) + field_table.intended_purposes() + \ field_work_detail.production_title + field_work_detail.cd_identifier + field_work_detail.cut_number + field_work_detail.library + field_work_detail.bltvr + field_special.visan() + field_work_detail.production_n + \ field_work_detail.episode_title + field_work_detail.episode_n + field_work_detail.year_production + field_special.audio_visual_key() + field_special.lineEnd
# Writer 1 Last Name writer_1_last_name = basic.alphanum(_config.field_size('entire_work_title', 'writer_last_name')) writer_1_last_name = writer_1_last_name.setName('Writer 1 Last Name').setResultsName( 'writer_1_last_name') # Writer 1 First Name writer_1_first_name = basic.alphanum(_config.field_size('entire_work_title', 'writer_first_name')) writer_1_first_name = writer_1_first_name.setName('Writer 1 Last Name').setResultsName( 'writer_1_first_name') # Writer 1 IPI Name # writer_1_ipi_name_n = special.ipi_name_number() writer_1_ipi_name_n = writer_1_ipi_name_n.setName('Writer 1 IPI Name #').setResultsName('writer_1_ipi_name_n') # Writer 1 IPI Base # writer_1_ipi_base_n = special.ipi_base_number() writer_1_ipi_base_n = writer_1_ipi_base_n.setName('Writer 1 IPI Base #').setResultsName('writer_1_ipi_base_n') # Writer 2 Last Name writer_2_last_name = basic.alphanum(_config.field_size('entire_work_title', 'writer_last_name')) writer_2_last_name = writer_2_last_name.setName('Writer 2 Last Name').setResultsName( 'writer_2_last_name') # Writer 2 First Name writer_2_first_name = basic.alphanum(_config.field_size('entire_work_title', 'writer_first_name')) writer_2_first_name = writer_2_first_name.setName('Writer 2 Last Name').setResultsName('writer_2_first_name') # Writer 2 IPI Name # writer_2_ipi_name_n = special.ipi_name_number() writer_2_ipi_name_n = writer_2_ipi_name_n.setName('Writer 1 IPI Name #').setResultsName('writer_2_ipi_name_n')