Skip to content

Commit

Permalink
Merge branch 'master' of https://bitbucket.org/dpaw/penguins
Browse files Browse the repository at this point in the history
Conflicts:
	AUTHORS
  • Loading branch information
Shayne O'Neill committed Jul 29, 2014
2 parents bfc0865 + 53ba2a7 commit 9ee8e8d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 2 deletions.
4 changes: 3 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ The PRIMARY AUTHORS are (and/or have been):
* Nick Sandford
* Drew Clarke
* Shayne O'Neill

* Ashley Felton
* Jawaid Mushtaq

Thank you to Scott Percival for designing the logo.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Penguin Observations Application
================================
7 changes: 7 additions & 0 deletions example-supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[program:penguins_8270]
user=www-data
directory=/var/www/penguins_8270
environment=PATH="/var/www/penguins_8270/venv/bin"
command=/var/www/penguins_8270/venv/bin/honcho start
stopasgroup=true
killasgroup=true
1 change: 1 addition & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
import sys
import materialize

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "penguins.settings")
Expand Down
4 changes: 3 additions & 1 deletion observations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Site(geo_models.Model):
location = geo_models.PointField()

def __str__(self):
return self.name
return "{} ({})".format( self.name, ', '.join([c.name.encode("ascii") for c in self.camera_set.all()]) )

class Meta:
ordering = ['name']
Expand Down Expand Up @@ -114,11 +114,13 @@ def import_folder(cls, folder="beach_return_cams"):
# create it
print("importing {0}".format(video))
datestr, camstr = nameparts
camstr = camstr.split(".")[0]
video_datetime = datetime.datetime.strptime(datestr, "%d-%m-%Y_%H")
date = video_datetime.date()
start_time = video_datetime.time()
# assume each video is 60 mins long (video times are inaccurate/halved?)
end_time = (video_datetime + datetime.timedelta(minutes=60)).time()
print("Finding camera name closest to {}".format(camstr))
camera = Camera.objects.get(name__istartswith=camstr.split("_")[0])
cls.objects.create(date=date, start_time=start_time, end_time=end_time,
camera=camera, file=os.path.join(folder, video))
Expand Down
1 change: 1 addition & 0 deletions observations/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ def index(self, request, extra_context=None):
site.register(PenguinCount, PenguinCountAdmin)
site.register(PenguinObservation, PenguinObservationAdmin)
site.register(Video, VideoAdmin)
site.register(Camera, CameraAdmin)
Binary file added observations/static/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions observations/templates/admin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "css/bootstrap.min.css" %}{% endblock %}" />
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap-theme.min.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "css/style.css" %}" />
<link rel="shortcut icon" type="image/png" href="{{STATIC_URL}}favicon.ico"/>
{% block extrastyle %}{% endblock %}
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions penguins/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@

AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'swingers.sauth.backends.EmailBackend',
)

LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'
LOGIN_REDIRECT_URL_FAILURE = LOGIN_URL
LOGOUT_URL = '/logout/'
LOGOUT_REDIRECT_URL = LOGOUT_URL
ANONYMOUS_USER_ID = -1

# LDAP settings
AUTH_LDAP_SERVER_URI = os.environ.get('LDAP_SERVER_URI')
Expand Down Expand Up @@ -170,6 +172,8 @@
'INTERCEPT_REDIRECTS': False,
}

# Application version number
APPLICATION_VERSION_NO = '0.1a'

JENKINS_TASKS = (
'django_jenkins.tasks.with_coverage',
Expand Down

0 comments on commit 9ee8e8d

Please sign in to comment.