def generateMusicPiece(index, discUri): me = 'nmm#MusicPiece' music_piece_uri = 'urn:music:%d' % index music_piece_title = 'Song %d' % index music_piece_size = str(index) music_piece_container = 'file://music/' music_piece_filename = 'Song_%d.mp3' % index music_piece_url = music_piece_container + music_piece_filename music_piece_mime = 'audio/mpeg' music_piece_date = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1) music_piece_last_accessed = music_piece_date music_piece_last_modified = music_piece_date music_piece_codec = 'MPEG' music_piece_bitrate = '%d' % (16 + (index % 300)) music_piece_genre = 'Genre %d' % (index % 1000) music_piece_channels = '2' music_piece_sample_rate = '44100.0' music_piece_album = tools.getLastUri('nmm#MusicAlbum') music_piece_artist = tools.getLastUri('nmm#Artist') music_piece_album_disk = discUri music_piece_length = '%d' % (1 + (index % 1000)) music_piece_track = '%d' % (1 + (index % 100)) tools.addItem(me, music_piece_uri, nmm_MusicPiece % locals())
def generateGeoLocation(index): me = 'mlo#GeoLocation' geolocation_uri = 'urn:geolocation:%d' % index geolocation_geopoint = tools.getLastUri( 'mlo#GeoPoint' ) geolocation_boundingbox = tools.getLastUri( 'mlo#LocationBoundingBox' ) geolocation_postaladdress = tools.getRandomUri( 'nco#PostalAddress' ) geolocation_saveas = (mlo_GeoLocation_saveas_boundingbox % locals(), mlo_GeoLocation_saveas_geopoint % locals(), mlo_GeoLocation_saveas_postaladdress % locals()) [ index %3 ] geolocation_comment = 'geolocation %d' % index tools.addItem( me, geolocation_uri, mlo_GeoLocation % locals() )
def generateLandmark(index): me = 'slo#Landmark' landmark_uri = 'urn:slolandmark:%d' % index landmark_title = 'Landmark %d' % index landmark_description = 'Landmark %d description' % index landmark_location = tools.getLastUri('slo#GeoLocation') tools.addItem(me, landmark_uri, slo_Landmark % locals())
def generateLandmark(index): me = 'slo#Landmark' landmark_uri = 'urn:slolandmark:%d' % index landmark_title = 'Landmark %d' % index landmark_description = 'Landmark %d description' % index landmark_location = tools.getLastUri( 'slo#GeoLocation' ) tools.addItem( me, landmark_uri, slo_Landmark % locals() )
def generateFeedMessage(index): me = 'mfo#FeedMessage' feed_message_uri = 'http://feed%d.feed.com/message%d.html' % (index % 1000, index) feed_message_title = 'Message %d' % index feed_message_description = 'Description %d' % (index % 1000) feed_message_comment = 'Comment %d' % index feed_message_channel = tools.getLastUri( 'mfo#FeedChannel' ) tools.addItem( me, feed_message_uri, mfo_FeedMessage % locals() )
def generateContactIM(index): me = 'nco#ContactIM' imcontact_uri = 'urn:contact:im%d' % index imcontact_name_given = 'Given%d' % (index % 1000) imcontact_name_family = 'Family%d' % (index % 1000) imcontact_nickname = 'Nickname%d' % (index % 1000) imcontact_imaddress_uri = '<%s>' % tools.getLastUri( 'nco#IMAddress' ) tools.addItem( me, imcontact_uri, nco_Contact_IM % locals() )
def generateContactEmail(index): me = 'nco#ContactEmail' emailcontact_uri = 'urn:contact:email%d' % index emailcontact_name_given = 'Given%d' % (index % 1000) emailcontact_name_family = 'Family%d' % (index % 1000) emailcontact_nickname = 'Nickname%d' % (index % 1000) emailcontact_email_address_uri= '<%s>' % tools.getLastUri( 'nco#EmailAddress' ) tools.addItem( me, emailcontact_uri, nco_Contact_Email % locals() )
def generateContactIM(index): me = 'nco#ContactIM' imcontact_uri = 'urn:contact:im%d' % index imcontact_name_given = 'Given%d' % (index % 1000) imcontact_name_family = 'Family%d' % (index % 1000) imcontact_nickname = 'Nickname%d' % (index % 1000) imcontact_imaddress_uri = '<%s>' % tools.getLastUri('nco#IMAddress') tools.addItem(me, imcontact_uri, nco_Contact_IM % locals())
def generateContactCall(index): me = 'nco#ContactCall' callcontact_uri = 'urn:contact:call%d' % index callcontact_name_given = 'Given%d' % (index % 1000) callcontact_name_family = 'Family%d' % (index % 1000) callcontact_nickname = 'Nickname%d' % (index % 1000) callcontact_phonenumber_uri = '<%s>' % tools.getLastUri('nco#PhoneNumber') tools.addItem(me, callcontact_uri, nco_Contact_Call % locals())
def generateContactCall(index): me = 'nco#ContactCall' callcontact_uri = 'urn:contact:call%d' % index callcontact_name_given = 'Given%d' % (index % 1000) callcontact_name_family = 'Family%d' % (index % 1000) callcontact_nickname = 'Nickname%d' % (index % 1000) callcontact_phonenumber_uri = '<%s>' % tools.getLastUri( 'nco#PhoneNumber' ) tools.addItem( me, callcontact_uri, nco_Contact_Call % locals() )
def generateContactEmail(index): me = 'nco#ContactEmail' emailcontact_uri = 'urn:contact:email%d' % index emailcontact_name_given = 'Given%d' % (index % 1000) emailcontact_name_family = 'Family%d' % (index % 1000) emailcontact_nickname = 'Nickname%d' % (index % 1000) emailcontact_email_address_uri = '<%s>' % tools.getLastUri( 'nco#EmailAddress') tools.addItem(me, emailcontact_uri, nco_Contact_Email % locals())
def generateFeedMessage(index): me = 'mfo#FeedMessage' feed_message_uri = 'http://feed%d.feed.com/message%d.html' % (index % 1000, index) feed_message_title = 'Message %d' % index feed_message_description = 'Description %d' % (index % 1000) feed_message_comment = 'Comment %d' % index feed_message_channel = tools.getLastUri('mfo#FeedChannel') tools.addItem(me, feed_message_uri, mfo_FeedMessage % locals())
def generatePersonContact(index): me = 'nco#PersonContact' contact_uri = 'urn:uid:%d' % index contact_name_given = 'Given%d' % (index % 1000) contact_name_family = 'Family%d' % (index % 1000) contact_name_additional = 'Additional%d' % (index % 1000) contact_nickname = 'Nickname%d' % (index % 1000) contact_honorific_prefix = ('Sir', 'Master') [index % 2] contact_honorific_suffix = ('PhD', 'Deceased') [index % 2] contact_birth_date = '%d-%02d-%02dT%02d:%02d:%02dZ' % (1900 + (index % 100), (index % 12) + 1, (index % 25) + 1, (index % 12) + 1, (index % 12) + 1, (index % 12) + 1) contact_gender = '<%s>' % ('nco:gender-female', 'nco:gender-female') [index % 2] contact_uid = 'uid:contact:%d' % index contact_note = 'Note number %d' % index email_address_uri = '<%s>' % tools.getLastUri( 'nco#EmailAddress' ) phonenumber_uri = '<%s>' % tools.getLastUri( 'nco#PhoneNumber' ) postal_address_uri = '<%s>' % tools.getLastUri( 'nco#PostalAddress' ) im_address_uri = '<%s>' % tools.getLastUri( 'nco#IMAddress' ) contact_created = '%d-%02d-%02dT%02d:%02d:%02dZ' % (1950 + (index % 50), (index % 12) + 1, (index % 25) + 1, (index % 12) + 1, (index % 12) + 1, (index % 12) + 1) contact_modified = '%d-%02d-%02dT%02d:%02d:%02dZ' % (1960 + (index % 40), (index % 12) + 1, (index % 25) + 1, (index % 12) + 1, (index % 12) + 1, (index % 12) + 1) tools.addItem( me, contact_uri, nco_PersonContact % locals() )
def generateEvent(index): me = 'ncal#Event' event_uri = 'urn:x-ical:%d' % index event_uid = '%d' % index event_start = '%d-%02d-%02dT09:00:00Z' % (2010 + (index % 5), (index % 12) + 1, (index % 25) + 1) event_end = '%d-%02d-%02dT17:00:00Z' % (2010 + (index % 5), (index % 12) + 1, (index % 25) + 1) event_summary = 'Event %d' % index event_created = tools.now event_modified = event_created alarm_uri = tools.getLastUri( 'ncal#Alarm' ) calendar_uri = tools.getRandomUri( 'ncal#Calendar' ) tools.addItem( me, event_uri, ncal_Event % locals() )
def generatePersonContact(index): me = 'nco#PersonContact' contact_uri = 'urn:uid:%d' % index contact_name_given = 'Given%d' % (index % 1000) contact_name_family = 'Family%d' % (index % 1000) contact_name_additional = 'Additional%d' % (index % 1000) contact_nickname = 'Nickname%d' % (index % 1000) contact_honorific_prefix = ('Sir', 'Master')[index % 2] contact_honorific_suffix = ('PhD', 'Deceased')[index % 2] contact_birth_date = '%d-%02d-%02dT%02d:%02d:%02dZ' % (1900 + (index % 100), (index % 12) + 1, (index % 25) + 1, (index % 12) + 1, (index % 12) + 1, (index % 12) + 1) contact_gender = '<%s>' % ('nco:gender-female', 'nco:gender-female')[index % 2] contact_uid = 'uid:contact:%d' % index contact_note = 'Note number %d' % index email_address_uri = '<%s>' % tools.getLastUri('nco#EmailAddress') phonenumber_uri = '<%s>' % tools.getLastUri('nco#PhoneNumber') postal_address_uri = '<%s>' % tools.getLastUri('nco#PostalAddress') im_address_uri = '<%s>' % tools.getLastUri('nco#IMAddress') contact_created = '%d-%02d-%02dT%02d:%02d:%02dZ' % (1950 + (index % 50), (index % 12) + 1, (index % 25) + 1, (index % 12) + 1, (index % 12) + 1, (index % 12) + 1) contact_modified = '%d-%02d-%02dT%02d:%02d:%02dZ' % (1960 + (index % 40), (index % 12) + 1, (index % 25) + 1, (index % 12) + 1, (index % 12) + 1, (index % 12) + 1) tools.addItem(me, contact_uri, nco_PersonContact % locals())
def generateMusicPiece(index, discUri): me = 'nmm#MusicPiece' music_piece_uri = 'urn:music:%d' % index music_piece_title = 'Song %d' % index music_piece_size = str(index) music_piece_container = 'file://music/' music_piece_filename = 'Song_%d.mp3' % index music_piece_url = music_piece_container + music_piece_filename music_piece_mime = 'audio/mpeg' music_piece_date = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1) music_piece_last_accessed = music_piece_date music_piece_last_modified = music_piece_date music_piece_codec = 'MPEG' music_piece_bitrate = '%d' % (16 + (index % 300)) music_piece_genre = 'Genre %d' % (index % 1000) music_piece_channels = '2' music_piece_sample_rate = '44100.0' music_piece_album = tools.getLastUri( 'nmm#MusicAlbum' ) music_piece_artist = tools.getLastUri( 'nmm#Artist' ) music_piece_album_disk = discUri music_piece_length = '%d' % (1 + (index % 1000)) music_piece_track = '%d' % (1 + (index % 100)) tools.addItem( me, music_piece_uri, nmm_MusicPiece % locals() )
def generateEvent(index): me = 'ncal#Event' event_uri = 'urn:x-ical:%d' % index event_uid = '%d' % index event_start = '%d-%02d-%02dT09:00:00Z' % (2010 + (index % 5), (index % 12) + 1, (index % 25) + 1) event_end = '%d-%02d-%02dT17:00:00Z' % (2010 + (index % 5), (index % 12) + 1, (index % 25) + 1) event_summary = 'Event %d' % index event_created = tools.now event_modified = event_created alarm_uri = tools.getLastUri('ncal#Alarm') calendar_uri = tools.getRandomUri('ncal#Calendar') tools.addItem(me, event_uri, ncal_Event % locals())