Permalink
Browse files

PEP8 indentation and whitespace on core.py

No logic changes. Only whitespace!
  • Loading branch information...
1 parent b8f9e6e commit 8df769591df24acfed076afac601b106e735ff7d @exhuma committed Apr 1, 2013
Showing with 23 additions and 6 deletions.
  1. +23 −6 lost_tracker/core.py
View
@@ -1,5 +1,12 @@
-from lost_tracker.models import (Group, Station, get_state,
- advance as db_advance, STATE_FINISHED, STATE_UNKNOWN, STATE_ARRIVED)
+from lost_tracker.models import (
+ Group,
+ Station,
+ get_state,
+ advance as db_advance,
+ STATE_FINISHED,
+ STATE_UNKNOWN,
+ STATE_ARRIVED)
+
def get_matrix(stations, groups):
@@ -11,6 +18,7 @@ def get_matrix(stations, groups):
state_matrix.append(tmp)
return state_matrix
+
def get_state_sum(state_matrix):
sums = []
if state_matrix:
@@ -23,15 +31,16 @@ def get_state_sum(state_matrix):
sums[i][STATE_ARRIVED] += 1
elif state == STATE_FINISHED:
sums[i][STATE_FINISHED] += 1
-
return sums
+
def get_grps():
groups = Group.query
groups = groups.order_by(Group.order)
groups = groups.all()
return groups
+
def add_grp(grp_name, contact, phone, direction, start_time, session):
if direction is "1":
color = "Giel"
@@ -40,22 +49,30 @@ def add_grp(grp_name, contact, phone, direction, start_time, session):
new_grp = Group(grp_name, contact, phone, direction, start_time)
session.add(new_grp)
- return "Group {0} with Contact {1} / {2} was successfully added into the DB. The given start-time is {3} and the direction is {4}".format(grp_name, contact, phone, start_time, color)
+ return ("Group {0} with Contact {1} / {2} was successfully added into the "
+ "DB. The given start-time is {3} and the direction is {4}".format(
+ grp_name,
+ contact,
+ phone,
+ start_time,
+ color))
+
def get_stations():
stations = Station.query
stations = stations.order_by(Station.order)
stations = stations.all()
return stations
+
def get_stat_by_name(name):
qry = Station.query
- qry = qry.filter_by( name = name )
+ qry = qry.filter_by(name=name)
qry = qry.first()
return qry
+
def add_station(stat_name, contact, phone, session):
new_station = Station(stat_name, contact, phone)
session.add(new_station)
return "Station " + stat_name + " added. Contact: " + contact + " / " + phone
-

0 comments on commit 8df7695

Please sign in to comment.