Exemplo n.º 1
0
def getNetworks(user1, start, end):
    '''
    Return dictionary of available networks via Arclink

   :type start: obspy.core.utcdatetime.UTCDateTime
   :param start: Start date and time
   :type end: obspy.core.utcdatetime.UTCDateTime
   :param end: End date and time
    '''

    for i in range(3):
       Logfile.add(' ','Waiting for dictionary of available geofon networks(via Arclink) ....')

       try:
          L= []
          client  = Client(user = user1)                           #hs
          #client = Client(user = user1, timeout=20)               #hs
          t   = client.getNetworks(start,end)

          for index,i in enumerate(t.iterkeys()):
             z = i.split('.')
             L.append(z[0])

          L = list(set(L))
          break

       except:
          Logfile.exception('getGeofonNetworks')
          Logfile.exception('Retry access')
          L = []
          continue
    #endfor

    return L