コード例 #1
0
ファイル: ncal.py プロジェクト: Codeminded/tracker
def generateTodo(index):
  me = 'ncal#Todo'
  todo_uri      = 'urn:todo::%d' % index
  todo_uid      = '%d' % index
  todo_summary  = 'Todo %d' % index
  todo_created  = tools.now
  todo_modified = todo_created
  alarm_uri     = tools.getRandomUri( 'ncal#Alarm' )
  calendar_uri  = tools.getRandomUri( 'ncal#Calendar' )

  tools.addItem( me, todo_uri, ncal_Todo % locals() )
コード例 #2
0
ファイル: ncal.py プロジェクト: isabella232/tracker-1
def generateTodo(index):
    me = 'ncal#Todo'
    todo_uri = 'urn:todo::%d' % index
    todo_uid = '%d' % index
    todo_summary = 'Todo %d' % index
    todo_created = tools.now
    todo_modified = todo_created
    alarm_uri = tools.getRandomUri('ncal#Alarm')
    calendar_uri = tools.getRandomUri('ncal#Calendar')

    tools.addItem(me, todo_uri, ncal_Todo % locals())
コード例 #3
0
ファイル: nfo.py プロジェクト: Codeminded/tracker
def generateSoftwareApplication(index):
  me = 'nfo#SoftwareApplication'
  application_cmdline       = 'app%d' % index
  application_filename      = application_cmdline + '.desktop'
  application_uri           = 'file://applications/' + application_filename
  application_title         = 'Application %d' % index
  application_part_of       = tools.getRandomUri( 'nfo#SoftwareCategory' )
  application_url           = application_uri
  application_datasource    = tools.getRandomUri( 'tracker#Volume' )
  application_last_modified = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
  application_icon          = 'urn:theme-icon:Icon-%d' % index

  tools.addItem( me, application_uri, nfo_SoftwareApplication % locals() )
コード例 #4
0
ファイル: nmo.py プロジェクト: isabella232/tracker-1
def generateCall(index):
    me = 'nmo#Call'
    call_uri = 'urn:call:%d' % index
    call_subject = 'Subject %d' % index
    call_date = tools.now
    call_modified = tools.now
    call_from = tools.getRandomUri('nco#ContactCall')
    call_to = tools.getRandomUri('nco#ContactCall')
    call_read = 'true'
    call_sent = 'true'
    call_received = tools.now
    call_sent_date = tools.now
    call_duration = '%d' % (10 + (index % 3600))

    tools.addItem(me, call_uri, nmo_Call % locals())
コード例 #5
0
ファイル: nmo.py プロジェクト: Codeminded/tracker
def generateCall(index):
  me = 'nmo#Call'
  call_uri         = 'urn:call:%d' % index
  call_subject     = 'Subject %d' % index
  call_date        = tools.now
  call_modified    = tools.now
  call_from        = tools.getRandomUri( 'nco#ContactCall' )
  call_to          = tools.getRandomUri( 'nco#ContactCall' )
  call_read        = 'true'
  call_sent        = 'true'
  call_received    = tools.now
  call_sent_date   = tools.now
  call_duration    = '%d' % ( 10 + (index % 3600) )

  tools.addItem( me, call_uri, nmo_Call % locals() )
コード例 #6
0
ファイル: nmo.py プロジェクト: isabella232/tracker-1
def generateMailFolder(index):
    me = 'nmo#MailFolder'
    mailfolder_uri = 'qmf://groove.nokia.com/folder#%d' % index
    mailfolder_account = '<%s>' % tools.getRandomUri('nmo#MailAccount')
    mailfolder_name = 'Folder %d' % (index % 1000)

    tools.addItem(me, mailfolder_uri, nmo_MailFolder % locals())
コード例 #7
0
ファイル: slo.py プロジェクト: isabella232/tracker-1
def generateGeoLocation(index):
    me = 'slo#GeoLocation'
    geolocation_uri = 'urn:slogeoloc:%d' % index
    geolocation_comment = 'Comment geolocation %d' % index
    geolocation_altitude = '%f' % (index % 1000)

    geolocation_latitude = '%f' % (((index % 360) - 180) / 2.0)
    geolocation_longitude = '%f' % ((index % 720) / 4.0)
    geolocation_hacc = '3'
    geolocation_vacc = '3'
    geolocation_radius = '10'

    geolocation_latitudemax = '%f' % (((index % 700) - 340) / 4.0)
    geolocation_latitudemin = '%f' % (((index % 700) - 350) / 4.0)
    geolocation_longitudemax = '%f' % (((index % 350) + 10) / 2.0)
    geolocation_longitudemin = '%f' % (((index % 350)) / 2.0)

    geolocation_postaladdress = tools.getRandomUri('nco#PostalAddress')

    geolocation_saveas = (slo_GeoLocation_saveas_boundingbox % locals(),
                          slo_GeoLocation_saveas_point % locals(),
                          slo_GeoLocation_saveas_postaladdress %
                          locals())[index % 3]

    tools.addItem(me, geolocation_uri, slo_GeoLocation % locals())
コード例 #8
0
ファイル: nmo.py プロジェクト: Codeminded/tracker
def generateMailFolder(index):
  me = 'nmo#MailFolder'
  mailfolder_uri     = 'qmf://groove.nokia.com/folder#%d' % index
  mailfolder_account = '<%s>' % tools.getRandomUri( 'nmo#MailAccount' )
  mailfolder_name    = 'Folder %d' % (index % 1000)

  tools.addItem( me, mailfolder_uri, nmo_MailFolder % locals() )
コード例 #9
0
ファイル: nmo.py プロジェクト: isabella232/tracker-1
def generateIMMessage(index):
    me = 'nmo#IMMessage'
    immessage_uri = 'urn:immessage:%d' % index
    immessage_content = 'Lorem IM Ipsum %d' % index
    immessage_date = tools.now
    immessage_modified = tools.now
    immessage_from = tools.getRandomUri('nco#ContactIM')
    immessage_to = tools.getRandomUri('nco#ContactIM')
    immessage_draft = ('false', 'true')[index % 2]
    immessage_read = ('false', 'true')[index % 2]
    immessage_sent = 'true'
    immessage_deleted = 'false'
    immessage_message_id = '%d' % index
    immessage_received = tools.now
    immessage_sent_date = tools.now
    immessage_channel_uri = tools.getRandomUri('nmo#CommunicationChannel')
    immessage_content = gen.create_text(1, 2)

    tools.addItem(me, immessage_uri, nmo_IMMessage % locals())
コード例 #10
0
ファイル: nmo.py プロジェクト: isabella232/tracker-1
def generateCommunicationChannel(index):
    me = 'nmo#CommunicationChannel'
    channel_uri = 'urn:channel:%d' % index
    channel_subject = '/org/freedesktop/Telepathy/Account/gabble/jabber/dut_40localhost0'
    channel_date = tools.now
    channel_modified = channel_date
    channel_last_message = channel_date
    channel_participant = tools.getRandomUri('nco#PersonContact')

    tools.addItem(me, channel_uri, nmo_CommunicationChannel % locals())
コード例 #11
0
ファイル: nmo.py プロジェクト: Codeminded/tracker
def generateCommunicationChannel(index):
  me = 'nmo#CommunicationChannel'
  channel_uri          = 'urn:channel:%d' % index
  channel_subject      = '/org/freedesktop/Telepathy/Account/gabble/jabber/dut_40localhost0'
  channel_date         = tools.now
  channel_modified     = channel_date
  channel_last_message = channel_date
  channel_participant  = tools.getRandomUri( 'nco#PersonContact' )

  tools.addItem( me, channel_uri, nmo_CommunicationChannel % locals() )
コード例 #12
0
ファイル: mto.py プロジェクト: Codeminded/tracker
def generateTransferElement(index):
  me = 'mto#TransferElement'
  transfer_uri         = 'http://www.sopranolive.org/contexts/tracker/generated_unique_id/%d' % (index % 1000)
  transfer_source      = tools.getRandomUri( 'nmm#Photo' )
  transfer_destination = 'http://www.uploadsite%d.com/item%d' % (index % 100, index )
  transfer_started     = tools.now
  transfer_completed   = tools.now
  transfer_state       = 'http://www.tracker-project.org/temp/mto#state-done'

  tools.addItem( me, transfer_uri, mto_TransferElement % locals() )
コード例 #13
0
ファイル: nmo.py プロジェクト: Codeminded/tracker
def generateIMMessage(index):
  me = 'nmo#IMMessage'
  immessage_uri         = 'urn:immessage:%d' % index
  immessage_content     = 'Lorem IM Ipsum %d' % index
  immessage_date        = tools.now
  immessage_modified    = tools.now
  immessage_from        = tools.getRandomUri( 'nco#ContactIM' )
  immessage_to          = tools.getRandomUri( 'nco#ContactIM' )
  immessage_draft       = ('false', 'true')[index % 2]
  immessage_read        = ('false', 'true')[index % 2]
  immessage_sent        = 'true'
  immessage_deleted     = 'false'
  immessage_message_id  = '%d' % index
  immessage_received    = tools.now
  immessage_sent_date   = tools.now
  immessage_channel_uri = tools.getRandomUri( 'nmo#CommunicationChannel' )
  immessage_content     = gen.create_text( 1, 2 )

  tools.addItem( me, immessage_uri, nmo_IMMessage % locals() )
コード例 #14
0
ファイル: nmo.py プロジェクト: Codeminded/tracker
def generateEmail(index):
  me = 'nmo#Email'
  email_uri       = 'qmf://groove.nokia.com/email%d' % index
  email_mime      = 'multipart/mixed'
  email_stored_as = 'urn:uuid:XX:%d' % index
  email_account   = tools.getRandomUri( 'nmo#MailAccount' )
  email_folder    = tools.getRandomUri( 'nmo#MailFolder' )
  email_size      = str(index)
  email_to        = tools.getRandomUri( 'nco#ContactEmail' )
  email_id        = str(index)
  email_subject   = 'Subject %d' % (index % 1000)
  email_received  = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
  email_from      = tools.getRandomUri( 'nco#ContactEmail' )
  email_sent      = '%d-%02d-%02dT01:01:02Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
  email_content   = gen.create_text(2,30)
  email_draft     = 'false'
  email_deleted   = 'false'

  tools.addItem( me, email_uri, nmo_Email % locals() )
コード例 #15
0
ファイル: nmo.py プロジェクト: isabella232/tracker-1
def generateSMSMessage(index):
    me = 'nmo#SMSMessage'
    smsmessage_uri = 'urn:sms:%d' % index
    smsmessage_id = '%d' % index
    smsmessage_content = 'Lorem SMS Ipsum %d' % index
    smsmessage_date = tools.now
    smsmessage_modified = tools.now
    smsmessage_from = tools.getRandomUri('nco#PersonContact')
    smsmessage_to = tools.getRandomUri('nco#PersonContact')
    smsmessage_draft = ('false', 'true')[index % 2]
    smsmessage_read = ('false', 'true')[index % 2]
    smsmessage_sent = 'true'
    smsmessage_deleted = 'false'
    smsmessage_message_id = '%d' % index
    smsmessage_received = tools.now
    smsmessage_sent_date = tools.now
    smsmessage_channel_uri = tools.getRandomUri('nmo#CommunicationChannel')
    smsmessage_content = gen.create_text(1, 5)

    tools.addItem(me, smsmessage_uri, nmo_SMSMessage % locals())
コード例 #16
0
ファイル: nmo.py プロジェクト: Codeminded/tracker
def generateSMSMessage(index):
  me = 'nmo#SMSMessage'
  smsmessage_uri         = 'urn:sms:%d' % index
  smsmessage_id          = '%d' % index
  smsmessage_content     = 'Lorem SMS Ipsum %d' % index
  smsmessage_date        = tools.now
  smsmessage_modified    = tools.now
  smsmessage_from        = tools.getRandomUri( 'nco#PersonContact' )
  smsmessage_to          = tools.getRandomUri( 'nco#PersonContact' )
  smsmessage_draft       = ('false', 'true')[index % 2]
  smsmessage_read        = ('false', 'true')[index % 2]
  smsmessage_sent        = 'true'
  smsmessage_deleted     = 'false'
  smsmessage_message_id  = '%d' % index
  smsmessage_received    = tools.now
  smsmessage_sent_date   = tools.now
  smsmessage_channel_uri = tools.getRandomUri( 'nmo#CommunicationChannel' )
  smsmessage_content     = gen.create_text( 1, 5 )

  tools.addItem( me, smsmessage_uri, nmo_SMSMessage % locals() )
コード例 #17
0
ファイル: mto.py プロジェクト: marco-c/tracker
def generateTransferElement(index):
    me = 'mto#TransferElement'
    transfer_uri = 'http://www.sopranolive.org/contexts/tracker/generated_unique_id/%d' % (
        index % 1000)
    transfer_source = tools.getRandomUri('nmm#Photo')
    transfer_destination = 'http://www.uploadsite%d.com/item%d' % (index % 100,
                                                                   index)
    transfer_started = tools.now
    transfer_completed = tools.now
    transfer_state = 'http://www.tracker-project.org/temp/mto#state-done'

    tools.addItem(me, transfer_uri, mto_TransferElement % locals())
コード例 #18
0
ファイル: nmm.py プロジェクト: Codeminded/tracker
def generateVideo(index):
  me = 'nmm#Video'
  video_uri          = 'urn:video:%d' % index
  video_filename     = 'video%d.jpg' % index
  video_url          = 'file:///path/' + video_filename
  video_size         = str(1000000 + index)
  video_date         = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
  video_equipment    = tools.getRandomUri( 'nfo#Equipment' )
  video_samplerate   = str(index)
  video_duration     = str(index)
  video_tag          = ('TEST', 'nomatch') [index %2]

  tools.addItem( me, video_uri, nmm_Video % locals() )
コード例 #19
0
ファイル: ncal.py プロジェクト: Codeminded/tracker
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() )
コード例 #20
0
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() )
コード例 #21
0
ファイル: nmm.py プロジェクト: Codeminded/tracker
def generatePhoto(index):
  me = 'nmm#Photo'
  photo_uri          = 'urn:photo:%d' % index
  photo_filename     = 'photo%d.jpg' % index
  photo_url          = 'file:///path/' + photo_filename
  photo_size         = str(1000000 + index)
  photo_equipment    = tools.getRandomUri( 'nfo#Equipment' )
  photo_exposure     = '0.%d' % index
  photo_fnumber      = '%d.0' % (1 + (index % 20))
  photo_focal_length = '%d.0' % (1 + (index % 500))
  photo_date         = '%d-%02d-%02dT%02d:01:01Z' % (1100 + (index % 997), (index % 12) + 1, (index % 31) + 1, (index %24))
  photo_tag          = ('TEST', 'nomatch') [index %2]

  tools.addItem( me, photo_uri, nmm_Photo % locals() )
コード例 #22
0
ファイル: mto.py プロジェクト: Codeminded/tracker
def generateUploadTransfer(index):
  me = 'mto#UploadTransfer'
  upload_uri     = 'mtransfer://%d' % index
  upload_state   = 'http://www.tracker-project.org/temp/mto#state-done'
  upload_method  = 'http://www.tracker-project.org/temp/mto#transfer-method-web'
  upload_created = tools.now
  upload_account = ('picasa', 'flickr', 'facebook', 'youtube')[ index % 4 ]

  # add some random transfers
  upload_transfers = ''
  for index in xrange (1, 2 + (index % 10)):
    upload_transfers += 'mto:transferList <%s> ;\n' % tools.getRandomUri( 'mto#TransferElement' )

  tools.addItem( me, upload_uri, mto_UploadTransfer % locals() )
コード例 #23
0
ファイル: nmo.py プロジェクト: isabella232/tracker-1
def generateEmail(index):
    me = 'nmo#Email'
    email_uri = 'qmf://groove.nokia.com/email%d' % index
    email_mime = 'multipart/mixed'
    email_stored_as = 'urn:uuid:XX:%d' % index
    email_account = tools.getRandomUri('nmo#MailAccount')
    email_folder = tools.getRandomUri('nmo#MailFolder')
    email_size = str(index)
    email_to = tools.getRandomUri('nco#ContactEmail')
    email_id = str(index)
    email_subject = 'Subject %d' % (index % 1000)
    email_received = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10),
                                                 (index % 12) + 1,
                                                 (index % 25) + 1)
    email_from = tools.getRandomUri('nco#ContactEmail')
    email_sent = '%d-%02d-%02dT01:01:02Z' % (2000 + (index % 10),
                                             (index % 12) + 1,
                                             (index % 25) + 1)
    email_content = gen.create_text(2, 30)
    email_draft = 'false'
    email_deleted = 'false'

    tools.addItem(me, email_uri, nmo_Email % locals())
コード例 #24
0
def generateVideo(index):
    me = 'nmm#Video'
    video_uri = 'urn:video:%d' % index
    video_filename = 'video%d.jpg' % index
    video_url = 'file:///path/' + video_filename
    video_size = str(1000000 + index)
    video_date = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10),
                                             (index % 12) + 1,
                                             (index % 25) + 1)
    video_equipment = tools.getRandomUri('nfo#Equipment')
    video_samplerate = str(index)
    video_duration = str(index)
    video_tag = ('TEST', 'nomatch')[index % 2]

    tools.addItem(me, video_uri, nmm_Video % locals())
コード例 #25
0
ファイル: nfo.py プロジェクト: Codeminded/tracker
def generatePlainTextDocument(index):
  me = 'nfo#PlainTextDocument'
  plaintext_document_datasource    = tools.getRandomUri( 'tracker#Volume' )
  plaintext_document_filename      = 'Plain_text_document_%d.txt' % (index % 1000)
  plaintext_document_container     = 'file://documents/'
  plaintext_document_url           = plaintext_document_container + plaintext_document_filename
  plaintext_document_uri           = plaintext_document_url
  plaintext_document_mime          = 'text/plain'
  plaintext_document_content       = gen.create_text(5,300)
  plaintext_document_stored_as     = plaintext_document_url
  plaintext_document_last_accessed ='%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
  plaintext_document_last_modified ='%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
  plaintext_document_size          = '%d' % (1 + (index % 1000000))

  tools.addItem( me, plaintext_document_uri, nfo_PlainTextDocument % locals() )
コード例 #26
0
ファイル: mto.py プロジェクト: marco-c/tracker
def generateUploadTransfer(index):
    me = 'mto#UploadTransfer'
    upload_uri = 'mtransfer://%d' % index
    upload_state = 'http://www.tracker-project.org/temp/mto#state-done'
    upload_method = 'http://www.tracker-project.org/temp/mto#transfer-method-web'
    upload_created = tools.now
    upload_account = ('picasa', 'flickr', 'facebook', 'youtube')[index % 4]

    # add some random transfers
    upload_transfers = ''
    for index in xrange(1, 2 + (index % 10)):
        upload_transfers += 'mto:transferList <%s> ;\n' % tools.getRandomUri(
            'mto#TransferElement')

    tools.addItem(me, upload_uri, mto_UploadTransfer % locals())
コード例 #27
0
def generatePhoto(index):
    me = 'nmm#Photo'
    photo_uri = 'urn:photo:%d' % index
    photo_filename = 'photo%d.jpg' % index
    photo_url = 'file:///path/' + photo_filename
    photo_size = str(1000000 + index)
    photo_equipment = tools.getRandomUri('nfo#Equipment')
    photo_exposure = '0.%d' % index
    photo_fnumber = '%d.0' % (1 + (index % 20))
    photo_focal_length = '%d.0' % (1 + (index % 500))
    photo_date = '%d-%02d-%02dT%02d:01:01Z' % (1100 + (index % 997),
                                               (index % 12) + 1,
                                               (index % 31) + 1, (index % 24))
    photo_tag = ('TEST', 'nomatch')[index % 2]

    tools.addItem(me, photo_uri, nmm_Photo % locals())
コード例 #28
0
ファイル: ncal.py プロジェクト: isabella232/tracker-1
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())
コード例 #29
0
ファイル: slo.py プロジェクト: Codeminded/tracker
def generateGeoLocation(index):
  me = 'slo#GeoLocation'
  geolocation_uri                     = 'urn:slogeoloc:%d' % index
  geolocation_comment                 = 'Comment geolocation %d' % index
  geolocation_altitude                = '%f' % (index % 1000)

  geolocation_latitude                = '%f' % (((index % 360) - 180)/2.0)
  geolocation_longitude               = '%f' % ((index % 720)/4.0)
  geolocation_hacc                    = '3'
  geolocation_vacc                    = '3'
  geolocation_radius                  = '10'

  geolocation_latitudemax             = '%f' % (((index % 700) - 340)/4.0)
  geolocation_latitudemin             = '%f' % (((index % 700) - 350)/4.0)
  geolocation_longitudemax            = '%f' % (((index % 350) + 10) /2.0)
  geolocation_longitudemin            = '%f' % (((index % 350))/2.0)

  geolocation_postaladdress           = tools.getRandomUri( 'nco#PostalAddress' )

  geolocation_saveas                  = (slo_GeoLocation_saveas_boundingbox % locals(),slo_GeoLocation_saveas_point % locals(),slo_GeoLocation_saveas_postaladdress % locals()) [ index %3 ]

  tools.addItem( me, geolocation_uri, slo_GeoLocation % locals() )