@@ -242,9 +242,9 @@ def get_seen(cls, timediff):
242
242
@classmethod
243
243
def get_appearances (cls , pokemon_id , timediff ):
244
244
'''
245
- :param pokemon_id: id of pokemon that we need appearances for
245
+ :param pokemon_id: id of Pokemon that we need appearances for
246
246
:param timediff: limiting period of the selection
247
- :return: list of pokemon appearances over a selected period
247
+ :return: list of Pokemon appearances over a selected period
248
248
'''
249
249
if timediff :
250
250
timediff = datetime .utcnow () - timediff
@@ -262,7 +262,7 @@ def get_appearances(cls, pokemon_id, timediff):
262
262
@classmethod
263
263
def get_appearances_times_by_spawnpoint (cls , pokemon_id , spawnpoint_id , timediff ):
264
264
'''
265
- :param pokemon_id: id of pokemon that we need appearances times for
265
+ :param pokemon_id: id of Pokemon that we need appearances times for
266
266
:param spawnpoint_id: spawnpoing id we need appearances times for
267
267
:param timediff: limiting period of the selection
268
268
:return: list of time appearances over a selected period
@@ -382,7 +382,7 @@ def get_spawnpoints_in_hex(cls, center, steps):
382
382
# examples: time shifted
383
383
# 0 ( 0 + 2700) = 2700 % 3600 = 2700 (0th minute to 45th minute, 15 minutes prior to appearance as time wraps around the hour.)
384
384
# 1800 (1800 + 2700) = 4500 % 3600 = 900 (30th minute, moved to arrive at 15th minute.)
385
- # todo: this DOES NOT ACCOUNT for pokemons that appear sooner and live longer, but you'll _always_ have at least 15 minutes, so it works well enough.
385
+ # todo: this DOES NOT ACCOUNT for Pokemon that appear sooner and live longer, but you'll _always_ have at least 15 minutes, so it works well enough.
386
386
location ['time' ] = cls .get_spawn_time (location ['time' ])
387
387
388
388
return filtered
@@ -1016,7 +1016,7 @@ class SpawnPoint(BaseModel):
1016
1016
# for example, a 30 minute spawn is 'hhss'
1017
1017
kind = CharField (max_length = 4 , default = 'hhhs' )
1018
1018
1019
- # links shows whether a pokemon encounter id changes between quartiles or stays the same
1019
+ # links shows whether a Pokemon encounter id changes between quartiles or stays the same
1020
1020
# both 1x45 and 1x60h3 have the kind of 'sssh', but the different links shows when the
1021
1021
# encounter id changes
1022
1022
# same encounter id is shared between two quartiles, links shows a '+',
@@ -1031,7 +1031,7 @@ class SpawnPoint(BaseModel):
1031
1031
missed_count = IntegerField (default = 0 )
1032
1032
1033
1033
# next 2 fields are to narrow down on the valid TTH window
1034
- # seconds after the hour of the latest pokemon seen time within the hour
1034
+ # seconds after the hour of the latest Pokemon seen time within the hour
1035
1035
latest_seen = IntegerField ()
1036
1036
1037
1037
# seconds after the hour of the earliest time wasn't seen after an appearance
@@ -1275,7 +1275,7 @@ def classify(cls, sp, scan_loc, now_secs, sighting=None):
1275
1275
# same: whether encounter ID was same or different over that time}
1276
1276
1277
1277
# for 60 min spawns ('ssss'), the largest gap doesn't give the earliest spawn point,
1278
- # because a pokemon is always there
1278
+ # because a Pokemon is always there
1279
1279
# use the union of all intervals where the same encounter ID was seen to find the latest_seen
1280
1280
# If a different encounter ID was seen, then the complement of that interval was the same
1281
1281
# ID, so union that complement as well
@@ -1444,7 +1444,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1444
1444
sp_id_list = []
1445
1445
now_secs = date_secs (now_date )
1446
1446
1447
- # consolidate the individual lists in each cell into one list of pokemon and a list of forts
1447
+ # consolidate the individual lists in each cell into one list of Pokemon and a list of forts
1448
1448
cells = map_dict ['responses' ]['GET_MAP_OBJECTS' ]['map_cells' ]
1449
1449
for cell in cells :
1450
1450
nearby_pokemons += cell .get ('nearby_pokemons' , [])
@@ -1457,7 +1457,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1457
1457
# Check for a 0/0/0 bad scan
1458
1458
# If we saw nothing and there should be visible forts, it's bad
1459
1459
if not len (wild_pokemon ) and not len (forts ) and ScannedLocation .visible_forts (step_location ):
1460
- log .warning ('Bad scan. Parsing found 0/0/0 pokemons /pokestops/gyms' )
1460
+ log .warning ('Bad scan. Parsing found 0/0/0 Pokemon /pokestops/gyms' )
1461
1461
log .info ('Common causes: captchas, IP bans, or using -ng and -nk arguments' )
1462
1462
return {
1463
1463
'count' : 0 ,
@@ -1467,8 +1467,8 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1467
1467
}
1468
1468
1469
1469
if not len (nearby_pokemons ) and not len (wild_pokemon ):
1470
- log .warning ('Nothing on nearby_pokemons or wild. Speed violation?' )
1471
- log .info ("Common causes: not using -speed, deleting or dropping the WorkerStatus table without waiting before restarting, or there really aren't any pokemon in 200m" )
1470
+ log .warning ('No nearby or wild Pokemon . Speed violation?' )
1471
+ log .info ("Common causes: not using -speed, deleting or dropping the WorkerStatus table without waiting before restarting, or there really aren't any Pokemon in 200m" )
1472
1472
1473
1473
scan_loc = ScannedLocation .get_by_loc (step_location )
1474
1474
done_already = scan_loc ['done' ]
@@ -1483,7 +1483,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1483
1483
.where ((Pokemon .disappear_time > datetime .utcnow ()) & (Pokemon .encounter_id << encounter_ids ))
1484
1484
.dicts ())
1485
1485
1486
- # Store all encounter_ids and spawnpoint_id for the pokemon in query (all thats needed to make sure its unique).
1486
+ # Store all encounter_ids and spawnpoint_id for the Pokemon in query (all thats needed to make sure its unique).
1487
1487
encountered_pokemon = [(p ['encounter_id' ], p ['spawnpoint_id' ]) for p in query ]
1488
1488
1489
1489
for p in wild_pokemon :
@@ -1511,7 +1511,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1511
1511
sighting ['tth_secs' ] = d_t_secs
1512
1512
1513
1513
# only update when TTH is seen for the first time
1514
- # just before pokemon migrations, Niantic sets all TTH to the exact time of the migration
1514
+ # just before Pokemon migrations, Niantic sets all TTH to the exact time of the migration
1515
1515
# not the normal despawn time
1516
1516
sp ['latest_seen' ] = d_t_secs
1517
1517
sp ['earliest_unseen' ] = d_t_secs
@@ -1536,7 +1536,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1536
1536
sp ['last_scanned' ] = datetime .utcfromtimestamp (p ['last_modified_timestamp_ms' ] / 1000.0 )
1537
1537
1538
1538
if (b64encode (str (p ['encounter_id' ])), p ['spawn_point_id' ]) in encountered_pokemon :
1539
- # If pokemon has been encountered before dont process it.
1539
+ # If Pokemon has been encountered before don't process it.
1540
1540
skipped += 1
1541
1541
continue
1542
1542
@@ -1642,7 +1642,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1642
1642
'enabled' : f ['enabled' ],
1643
1643
'latitude' : f ['latitude' ],
1644
1644
'longitude' : f ['longitude' ],
1645
- 'last_modified ' : f ['last_modified_timestamp_ms' ],
1645
+ 'last_modified_time ' : f ['last_modified_timestamp_ms' ],
1646
1646
'lure_expiration' : l_e ,
1647
1647
'active_fort_modifier' : active_fort_modifier
1648
1648
}))
@@ -1691,12 +1691,13 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1691
1691
f ['last_modified_timestamp_ms' ] / 1000.0 ),
1692
1692
}
1693
1693
1694
- log .info ('Parsing found %d pokemons , %d pokestops, and %d gyms.' ,
1694
+ log .info ('Parsing found %d Pokemon, %d nearby , %d pokestops, and %d gyms.' ,
1695
1695
len (pokemons ) + skipped ,
1696
+ len (nearby_pokemons ),
1696
1697
len (pokestops ) + stopsskipped ,
1697
1698
len (gyms ))
1698
1699
1699
- log .debug ('Skipped %d Pokemons and %d pokestops.' , skipped , stopsskipped )
1700
+ log .debug ('Skipped %d Pokemon and %d pokestops.' , skipped , stopsskipped )
1700
1701
1701
1702
# look for spawnpoints within scan_loc that are not here to see if can narrow down tth window
1702
1703
for sp in ScannedLocation .linked_spawn_points (scan_loc ['cellid' ]):
@@ -1709,13 +1710,13 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, a
1709
1710
if clock_between (endpoints [0 ], now_secs , endpoints [1 ]):
1710
1711
sp ['missed_count' ] += 1
1711
1712
spawn_points [sp ['id' ]] = sp
1712
- log .warning ('%s kind spawnpoint %s has no pokemon %d times in a row' ,
1713
+ log .warning ('%s kind spawnpoint %s has no Pokemon %d times in a row' ,
1713
1714
sp ['kind' ], sp ['id' ], sp ['missed_count' ])
1714
1715
log .info ('Possible causes: Still doing initial scan, or super rare double spawnpoint during hidden period, or Niantic has removed spawnpoint' )
1715
1716
1716
1717
if (not SpawnPoint .tth_found (sp ) and scan_loc ['done' ] and
1717
1718
(sp ['earliest_unseen' ] - sp ['latest_seen' ] - args .spawn_delay ) % 3600 < 60 ):
1718
- log .warning ('Spawnpoint %s was unable to locate a TTH, with only %ss after pokemon last seen' ,
1719
+ log .warning ('Spawnpoint %s was unable to locate a TTH, with only %ss after Pokemon last seen' ,
1719
1720
sp ['id' ], (sp ['earliest_unseen' ] - sp ['latest_seen' ]) % 3600 )
1720
1721
log .info ('Embiggening search for TTH by 15 minutes to try again' )
1721
1722
if sp ['id' ] not in sp_id_list :
@@ -1914,7 +1915,7 @@ def clean_db_loop(args):
1914
1915
.where (Pokestop .lure_expiration < datetime .utcnow ()))
1915
1916
query .execute ()
1916
1917
1917
- # If desired, clear old pokemon spawns.
1918
+ # If desired, clear old Pokemon spawns.
1918
1919
if args .purge_data > 0 :
1919
1920
query = (Pokemon
1920
1921
.delete ()
@@ -2041,7 +2042,7 @@ def database_migrate(db, old_ver):
2041
2042
db .drop_tables ([ScannedLocation ])
2042
2043
2043
2044
if old_ver < 5 :
2044
- # Some pokemon were added before the 595 bug was "fixed".
2045
+ # Some Pokemon were added before the 595 bug was "fixed".
2045
2046
# Clean those up for a better UX.
2046
2047
query = (Pokemon
2047
2048
.delete ()
0 commit comments