Skip to content

Commit

Permalink
style: pep8, pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
samael500 committed Oct 24, 2014
1 parent 6dc5198 commit 84f5745
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
16 changes: 8 additions & 8 deletions sevboats/sb.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from src.engine import *
from src.engine import _update_ais_data, _update_ais_lastpos
from src.coordinates import Coordinates
# from src.engine import *
# from src.engine import _update_ais_data, _update_ais_lastpos
# from src.coordinates import Coordinates

initial()
_update_ais_data()
_update_ais_lastpos()
# initial()
# _update_ais_data()
# _update_ais_lastpos()

SlL.fleet().print_ships(True)
print 'on routes: ', check_ships_on_routes()
# SlL.fleet().print_ships(True)
# print 'on routes: ', check_ships_on_routes()
3 changes: 2 additions & 1 deletion sevboats/src/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ def _check_ships_on_routes():
potential += 1

if not moved_on_routes and (potential >= Ship.CRITICAL_MINIMUM):
return potential
return potential
return moved_on_routes


def send_fleet_message():
""" Check fleet status on ais and return message to send to twitter """
_update_ais_data()
Expand Down
2 changes: 1 addition & 1 deletion sevboats/src/ships.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def update(self, data):

def update_status(self):
""" Change ship status """
status_old = self.status
status_old = self.status # noqa
status_new = None
# check different situation
if self.coordinates is None:
Expand Down
9 changes: 6 additions & 3 deletions sevboats/tests/scrapper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ def setUp(self):
# change timelimit and scrapp urls
self.scrapper.timeout = 0
file_url = r'file:///'
self.scrapper.ships_list_url = file_url + os.path.join(BASE_DIR, 'sevboats', 'tests', 'test_data', 'list-page:{page}.html')
self.scrapper.ships_list_url = file_url + os.path.join(
BASE_DIR, 'sevboats', 'tests', 'test_data', 'list-page:{page}.html')
self.scrapper.ship_info_url = file_url + os.path.join(BASE_DIR, 'sevboats', 'tests', 'test_data', 'list.html')
self.scrapper.ship_lastpos_url = file_url + os.path.join(BASE_DIR, 'sevboats', 'tests', 'test_data', 'lastpos.html')
self.scrapper.none_url = file_url + os.path.join(BASE_DIR, 'sevboats', 'tests', 'test_data', '{types}_none.html')
self.scrapper.ship_lastpos_url = file_url + os.path.join(
BASE_DIR, 'sevboats', 'tests', 'test_data', 'lastpos.html')
self.scrapper.none_url = file_url + os.path.join(
BASE_DIR, 'sevboats', 'tests', 'test_data', '{types}_none.html')
self.mmsi_list = (
'272083500', '272083600', '272083700', '272083800', '272092200', '272093800', '272093900',
'272094100', '272094200', '272094300', '272094700', '272100500', '272105400', '272105500',
Expand Down
1 change: 0 additions & 1 deletion sevboats/tests/ship_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ def test_ship_str(self):
""" Check str and unicode """
self.assertEquals('URAN: OFFLINE', str(self.ship))
self.assertEquals(u'Уран: 272105400 - OFFLINE', unicode(self.ship))

0 comments on commit 84f5745

Please sign in to comment.