Skip to content

Commit

Permalink
Merge branch 'feature/ignore-pos' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eve-n0rman committed Apr 27, 2021
2 parents b7ac9bd + b042fc1 commit dcb4a96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions structurebot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'TOO_SOON': datetime.timedelta(days=int(os.getenv('TOO_SOON', 3))),
'CORPORATION_NAME': os.getenv('CORPORATION_NAME'),
'SLACK_CHANNEL': os.getenv('SLACK_CHANNEL', None),
'IGNORE_POS': os.getenv('IGNORE_POS', False),
'STRONT_HOURS': os.getenv('STRONT_HOURS', 12),
'DEBUG': os.getenv('DEBUG', False),
'DETONATION_WARNING': datetime.timedelta(days=os.getenv('DETONATION_WARNING', 1)),
Expand Down
2 changes: 2 additions & 0 deletions structurebot/pos.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def from_name(self):
def from_corp_name(corp_name, corp_assets=None):
pos_mod_dict = {}
pos_list = []
if CONFIG['IGNORE_POS']:
return pos_list
corp_assets = corp_assets or Asset.from_entity_name(corp_name)
assets = [a for a in corp_assets if Pos.is_pos_mod(a)]
pos_mods = [m for m in assets if m.group.name != 'Control Tower']
Expand Down
2 changes: 1 addition & 1 deletion tests/test_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ def test_inaccessible(self):

def test_accessible(self):
bravestar = citadels.Structure(1032110505696, type_id=35834)
self.assertEqual(str(bravestar), 'GE-8JV - Mothership Bellicose (1032110505696) - Keepstar')
self.assertEqual(str(bravestar), 'GE-8JV - Mothership Bellicose -R (1032110505696) - Keepstar')
self.assertTrue(bravestar.accessible)

0 comments on commit dcb4a96

Please sign in to comment.