Ignore:
Timestamp:
Dec 23, 2011, 8:31:50 AM (13 years ago)
Author:
rick
Message:

Correct annoying typo in naming of the acces*s* point.

Location:
src/django_gheat/gheat
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/gheat/admin.py

    r9818 r9819  
    22from django.contrib import admin
    33
    4 class AccespointAdmin(admin.ModelAdmin):
     4class AccesspointAdmin(admin.ModelAdmin):
    55  list_display = ['ssid','type', 'mac', 'organization']
    66  search_fields = ['ssid', 'mac', 'organization']
    77  ordering = ['ssid']
    8 admin.site.register(Accespoint, AccespointAdmin)
     8admin.site.register(Accesspoint, AccesspointAdmin)
    99
    1010class MeetBestandInline(admin.TabularInline):
     
    3535
    3636class MetingAdmin(admin.ModelAdmin):
    37   list_display = ['accespoint', 'latitude', 'longitude', 'signaal']
    38   search_fields = ['accespoint__ssid']
     37  list_display = ['accesspoint', 'latitude', 'longitude', 'signaal']
     38  search_fields = ['accesspoint__ssid']
    3939admin.site.register(Meting, MetingAdmin)
  • src/django_gheat/gheat/base.py

    r9041 r9819  
    77import gheat
    88import gheat.opacity
    9 from gheat.models import Accespoint, Gebruiker, Meting
     9from gheat.models import Accesspoint, Gebruiker, Meting
    1010from gheat import gheatsettings as settings
    1111from gheat import gmerc
  • src/django_gheat/gheat/dataimport/__init__.py

    r9818 r9819  
    7474
    7575
    76 def import_accespoints(ap_pool, counters):
    77   # Determine which Accespoints to add
    78   bssid_list_present = Accespoint.objects.filter(mac__in=ap_pool.keys()).\
     76def import_accesspoints(ap_pool, counters):
     77  # Determine which Accesspoints to add
     78  bssid_list_present = Accesspoint.objects.filter(mac__in=ap_pool.keys()).\
    7979    values_list('mac', flat=True)
    8080  bssid_list_insert = set(ap_pool.keys()) - set(bssid_list_present)
     
    8585    for bssid in bssid_list_insert:
    8686      ssid, encryption = ap_pool[bssid]
    87       type = Accespoint.get_type_by_ssid(ssid)
     87      type = Accesspoint.get_type_by_ssid(ssid)
    8888      # Special trick in SSID ts avoid escaping in later stage
    8989      item = str((bssid.upper(),ssid.replace('%','%%'),encryption,
    90          Accespoint.get_type_by_ssid(ssid),
     90         Accesspoint.get_type_by_ssid(ssid),
    9191        get_organization_id_by_ssid(ssid)))
    9292      sql_values.append(item)
    93     counters['ap_added'] = bulk_sql('gheat_accespoint (`mac`, `ssid`,\
     93    counters['ap_added'] = bulk_sql('gheat_accesspoint (`mac`, `ssid`,\
    9494      `encryptie`, `type`, `organization_id`)',sql_values)
    9595  return counters
     
    104104  # Build mapping for meting import
    105105  mac2id = {}
    106   for mac,id in Accespoint.objects.filter(mac__in=bssid_list).\
     106  for mac,id in Accesspoint.objects.filter(mac__in=bssid_list).\
    107107    values_list('mac','id'):
    108108    mac2id[mac] = int(id)
     
    134134  if sql_values:
    135135    counters['meting_added'] = bulk_sql('gheat_meting (`meetrondje_id`,\
    136       `accespoint_id`, `latitude`, `longitude`, `signaal`)',sql_values)
     136      `accesspoint_id`, `latitude`, `longitude`, `signaal`)',sql_values)
    137137  return counters
    138138
     
    186186
    187187  if ap_pool:
    188     counters = import_accespoints(ap_pool, counters)
     188    counters = import_accesspoints(ap_pool, counters)
    189189  if client_pool:
    190190    counters = import_clients(client_pool, counters)
     
    192192    counters = import_metingen(meetrondje, meting_pool, counters)
    193193
    194   logger.debug("summary accespoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
     194  logger.debug("summary accesspoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
    195195  logger.debug("summary client     : total:%(client_total)-6s added:%(client_added)-6s failed:%(client_failed)-6s ignored:%(client_ignored)-6s" % counters)
    196196  logger.debug("summary metingen   : total:%(meting_total)-6s added:%(meting_added)-6s failed:%(meting_failed)-6s ignored:%(meting_ignored)-6s" % counters)
  • src/django_gheat/gheat/dataimport/kismet.py

    r9668 r9819  
    1717    raise IOError(e)
    1818
    19   # Prepare new accespoints and measurements
     19  # Prepare new accesspoints and measurements
    2020  wnetworks = netxml_doc.findall('wireless-network')
    2121
     
    5555  bssid_failed = defaultdict(int)
    5656
    57   # Prepare new accespoints and measurements
     57  # Prepare new accesspoints and measurements
    5858  points = gpsxml_doc.findall('gps-point')
    5959
  • src/django_gheat/gheat/management/commands/add_random_points.py

    r9057 r9819  
    1919  equipment, created = Apparatuur.objects.get_or_create(antenne='itern', kaart='device')
    2020
    21   accespoint, created = Accespoint.objects.get_or_create(mac='00:11:22:33:44',
     21  accesspoint, created = Accesspoint.objects.get_or_create(mac='00:11:22:33:44',
    2222    ssid='ap-WirelessLeiden-Test', encryptie=True)
    2323
     
    2727  rondje.save()
    2828
    29   sql_insert = "INSERT INTO gheat_meting (meetrondje_id, accespoint_id, lat, lng, signaal) VALUES ";
     29  sql_insert = "INSERT INTO gheat_meting (meetrondje_id, accesspoint_id, lat, lng, signaal) VALUES ";
    3030  sql_insert_values = []
    3131  for i in range(0,count):
     
    3838    #  print "#Importing Random mesurements: %s/%s" % (i,count)
    3939    #meting = Meting.objects.create(meetrondje=rondje,
    40     #    accespoint=accespoint,latitude=latitude,
     40    #    accesspoint=accesspoint,latitude=latitude,
    4141    #    longitude=longitude,signaal=signal)
    4242    #meting.save()
    43     sql_insert_values.append("('" + "','".join(map(str,[rondje.id, accespoint.id, latitude, longitude, signal])) + "')")
     43    sql_insert_values.append("('" + "','".join(map(str,[rondje.id, accesspoint.id, latitude, longitude, signal])) + "')")
    4444
    4545  sql_insert += ','.join(sql_insert_values) + ';';
  • src/django_gheat/gheat/management/commands/import_datafile.py

    r9669 r9819  
    139139
    140140      counters = import_file(filename,meetrondje)
    141       logger.info("summary accespoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
     141      logger.info("summary accesspoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)
    142142      logger.info("summary client     : total:%(client_total)-6s added:%(client_added)-6s failed:%(client_failed)-6s ignored:%(client_ignored)-6s" % counters)
    143143      logger.info("summary metingen   : total:%(meting_total)-6s added:%(meting_added)-6s failed:%(meting_failed)-6s ignored:%(meting_ignored)-6s" % counters)
  • src/django_gheat/gheat/models.py

    r9818 r9819  
    77MAX_SIGNAL = 100
    88
    9 ACCESPOINT_TYPE_CHOICES= (
    10   ('accespoint', 'Acess Point'),
     9ACCESSPOINT_TYPE_CHOICES= (
     10  ('accesspoint', 'Acess Point'),
    1111  ('interlink', 'InterLink'),
    1212)
     
    7272    return "%s - %s" % (self.name, self.organization)
    7373
    74 class Accespoint(models.Model):
     74class Accesspoint(models.Model):
    7575  mac = models.CharField(max_length=17)
    7676  ssid = models.CharField(max_length=64)
    77   type = models.CharField(max_length=20, null=True, blank=True, choices=ACCESPOINT_TYPE_CHOICES)
     77  type = models.CharField(max_length=20, null=True, blank=True, choices=ACCESSPOINT_TYPE_CHOICES)
    7878  organization = models.ForeignKey(Organization,null=True, blank=True)
    7979  encryptie = models.BooleanField()
     
    8686  def get_type_by_ssid(ssid):
    8787    if ssid.startswith('ap'):
    88       type = 'accespoint'
     88      type = 'accesspoint'
    8989    elif ssid.startswith('il'):
    9090      type = 'interlink'
     
    9494
    9595  def save(self, *args, **kwargs):
    96     super(Accespoint, self).save(*args, **kwargs)
     96    super(Accesspoint, self).save(*args, **kwargs)
    9797
    9898class Gebruiker(models.Model):
     
    141141class Meting(models.Model):
    142142  meetrondje = models.ForeignKey(MeetRondje)
    143   accespoint = models.ForeignKey(Accespoint)
     143  accesspoint = models.ForeignKey(Accesspoint)
    144144  latitude = models.FloatField()
    145145  longitude = models.FloatField()
    146146  signaal = IntegerRangeField(max_length=3,min_value=MIN_SIGNAL,max_value=MAX_SIGNAL)
    147147  def __unicode__(self):
    148     return "%s @ %.5f,%.5f : %s" % (self.accespoint.ssid, float(self.latitude), float(self.longitude), self.signaal)
     148    return "%s @ %.5f,%.5f : %s" % (self.accesspoint.ssid, float(self.latitude), float(self.longitude), self.signaal)
    149149  class Meta:
    150150    # This implies that you cannot have multiple messurements on the same
    151151    # location for a single 'run', thus the data needs cleaned before to make
    152152    # this properly hold.
    153     unique_together = ('meetrondje', 'accespoint', 'latitude', 'longitude'),
     153    unique_together = ('meetrondje', 'accesspoint', 'latitude', 'longitude'),
    154154    verbose_name_plural = 'Metingen'
    155155
Note: See TracChangeset for help on using the changeset viewer.