Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

oggs on html

  • Loading branch information...
commit 7651f84ed813147e29f9fcb2c8db124de2690a48 1 parent 9f46a01
Carl Karsten authored
View
8 dj/main/models.py
@@ -1,6 +1,7 @@
# models.py
from django.db import models
+import os
import datetime
class Client(models.Model):
@@ -42,7 +43,10 @@ class Raw_File(models.Model):
help_text='when recorded (should agree with file name and timestamp)')
end = models.DateTimeField(null=True, blank=True)
trash = models.BooleanField(help_text="This clip is trash")
+ ocrtext = models.TextField(null=True,blank=True)
comment = models.TextField(blank=True)
+ def basename(self):
+ return os.path.splitext(self.filename)[0]
def duration(self):
""" returns the lenth in seconds """
duration = (self.end - self.start).seconds
@@ -76,7 +80,7 @@ class Episode(models.Model):
help_text="pointer to master version of event (name,desc,time,author,files,etc)")
name = models.CharField(max_length=135, help_text="(synced from primary source)")
slug = models.CharField(max_length=135,help_text="used for file name")
- authors = models.TextField(blank=True,)
+ authors = models.TextField(null=True,blank=True,)
description = models.TextField(blank=True, help_text="(synced from primary source)")
start = models.DateTimeField(null=True, blank=True,
help_text="initially scheduled time from master, adjusted to match reality")
@@ -100,7 +104,7 @@ class Cut_List(models.Model):
help_text='offset from start in HH:MM:SS.SS')
comment = models.TextField(blank=True)
def __unicode__(self):
- return "%s - %s" % (self.start, self.end)
+ return "%s - %s" % (self.raw_file, self.episode)
class State(models.Model):
sequence = models.IntegerField(default=1)
View
14 dj/main/templates/episode.html
@@ -3,17 +3,16 @@
{% block content %}
<h2>{{episode.location}}</h2>
-<h2>{{episode.name}}</h2>
+<h2>Title: {{episode.name}}</h2>
+<h2>Author(s): {{episode.authors}}</h2>
<table border=1px>
<tr><td>Date</td><td>{{episode.start|date:"b D d"}}</td></tr>
<tr><td>Start</td><td>{{episode.start}}</td><td>{{episode.start|date:"P"}}</td></tr>
<tr><td>End</td><td>{{episode.end}}</td> <td>{{episode.end|date:"P"}}</td></tr>
</table>
-</p>
-
<table border=1px>
-<tr><th>Useful</th><th>Seq</th><th>filename</th><th>Start</th><th>End</th><th>S</th><th>E</th><th>duration h:m:s</th></tr>
+<tr><th></th><th>Seq</th><th>filename</th><th>Start</th><th>End</th><th>S</th><th>E</th><th>duration h:m:s</th></tr>
{% for cl in cuts %}
<tr>
<td> {{ cl.trash|yesno:"Trash,,Unchecked" }} </td>
@@ -24,6 +23,13 @@
<td> {{cl.raw_file.start|date:"P"}} </td> <td> {{cl.raw_file.end|date:"P"}}</td>
<td> {{cl.raw_file.durationhms}} </td>
</tr>
+<tr>
+<td><a href="/site_media/{{episode.location.show.client.slug}}/{{episode.location.show.slug}}/dv/{{cl.raw_file.start|date:"Y-m-d"}}/{{episode.location.slug}}/{{cl.raw_file.basename}}.jpg">
+<img src="/site_media/{{episode.location.show.client.slug}}/{{episode.location.show.slug}}/dv/{{cl.raw_file.start|date:"Y-m-d"}}/{{episode.location.slug}}/{{cl.raw_file.basename}}.jpg" width=200> </a>
+</td>
+<td>{{cl.raw_file.ocrtext}}</td>
+<td><video src="/site_media/{{episode.location.show.client.slug}}/{{episode.location.show.slug}}/dv/{{cl.raw_file.start|date:"Y-m-d"}}/{{episode.location.slug}}/{{cl.raw_file.basename}}.ogg" controls ></video> </td>
+</tr>
{% endfor %}
</table>
View
36 dj/scripts/adddv.py
@@ -3,22 +3,28 @@
# Adds the .dv files to the raw files table
import os,sys
-import datetime
+import datetime, time
from dateutil.parser import parse
+import ocrdv
+import dvdate
+
sys.path.insert(0, '..' )
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import settings
+settings.DATABASE_NAME="../vp.db"
from main.models import Show, Location, Episode, Raw_File, Cut_List
-root='/home/juser/Videos' # root dir of .dv files
+root='/home/carl/Videos' # root dir of .dv files
+
timetweak = -3600 # seconds to adjust file timestamp to reality (like timezones)
show = Show.objects.get(name='PyOhio09')
print show
+root="%s/%s/%s/" % (root,show.client.slug,show.slug)
Raw_File.objects.filter(location__show=show).delete()
@@ -27,21 +33,33 @@
print dt
locs = Location.objects.filter(show=show)
for loc in locs:
- dir="%s/%s/dv/%s/%s" % (root,show.name,dt,loc.slug)
+ dir="%s/dv/%s/%s" % (root,dt,loc.slug)
print dir
files=os.listdir(dir)
- for dv in files:
+ for dv in [f for f in files if f[-3:]=='.dv']:
print dv
- st = os.stat("%s/%s"%(dir,dv))
- start = datetime.datetime.fromtimestamp( st.st_mtime ) + \
- datetime.timedelta(seconds=timetweak)
- duration = st.st_size/(120000*29.90) ## seconds
+ pathname = "%s/%s"%(dir,dv)
+ # get the timestamp from the dv (so from the camera)
+ start = dvdate.get_timestamp(pathname)
+ ts = time.mktime(start.timetuple())
+ # set the file time stamp
+ os.utime(pathname,(ts,ts))
+ st = os.stat(pathname)
+ # start = datetime.datetime.fromtimestamp( st.st_mtime )
+ start += datetime.timedelta(seconds=timetweak)
+ frames = st.st_size/120000
+ duration = frames/ 29.90 ## seconds
end = start + datetime.timedelta(seconds=duration)
print start, end, duration, duration/60
+ orctext,img=ocrdv.ocrdv(pathname, frames)
+ imgname = os.path.splitext(pathname)[0]+".jpg"
+ img.save(imgname,'jpeg')
+
rf, created = Raw_File.objects.get_or_create(
location=loc,
filename=dv,
- start=start,end=end)
+ start=start,end=end,
+ ocrtext=orctext)
if not created: print "dupe"
if parse(dt).date() != start.date():
print "wtf"
View
23 dj/scripts/addeps.py
@@ -11,22 +11,32 @@
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import settings
+print settings.DATABASE_NAME
+settings.DATABASE_NAME="../vp.db"
-from main.models import Show, Location, Episode
+from main.models import Client, Show, Location, Episode
-show = Show.objects.get(name='PyOhio09')
+Client.objects.all().delete()
+Show.objects.all().delete()
+client,created = Client.objects.get_or_create(name='PyOhio',slug="pyohio")
+show,created = Show.objects.get_or_create(name='PyOhio09',slug="pyohio09",client=client)
print show
# clear out previous runs for this show
Episode.objects.filter(location__show=show).delete()
+Location.objects.filter(show=show).delete()
reader = DictReader(open("sched.csv", "rb"))
{'Date': '2009-07-25', 'title': '#12 Getting Started With Django', 'Room': 'Auditorium', 'Time': '11:00:00 AM'}
seq=1
for row in reader:
print row
- loc = Location.objects.get(show=show,name=row['Room'])
+ location= ''.join([c for c in row['Room'] if c.isalpha() or c.isdigit()]).lower()
+ loc,created = Location.objects.get_or_create(show=show,name=row['Room'],slug=location)
print loc
+ name = row['title']
+ if name.startswith('#'): name = ' '.join(name.split()[1:])
+ slug = ''.join([c for c in name if c.isalpha() or c.isdigit()]).lower()
dt = row['Date']+' '+ row['Time']
start=parse(dt)
end=start+timedelta(minutes=65)
@@ -34,11 +44,10 @@
ep = Episode(
sequence=seq,
location=loc,
- name=row['title'],
+ name=name,
+ slug=slug,
+ authors=row['presenter(s)'],
start=start, end=end,
).save()
seq+=1
-
-
-
View
13 dj/scripts/mkdirs.py
@@ -8,21 +8,26 @@
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import settings
+settings.DATABASE_NAME="../vp.db"
+
from main.models import Show, Location
-root='/home/juser/Videos'
+root='/home/carl/Videos'
show = Show.objects.get(name='PyOhio09')
print show
-os.makedirs("%s/%s/dv" % (root,show.name))
+# os.makedirs("%s/%s/dv" % (root,show.slug))
+os.makedirs("%s/%s/jpg" % (root,show.slug))
for dt in ['2009-07-25','2009-07-26']:
print dt
- dir="%s/%s/dv/%s" % (root,show.name,dt)
+ # dir="%s/%s/dv/%s" % (root,show.slug,dt)
+ dir="%s/%s/jpg/%s" % (root,show.slug,dt)
os.mkdir(dir)
locs = Location.objects.filter(show=show)
for loc in locs:
- dir="%s/%s/dv/%s/%s" % (root,show.name,dt,loc.slug)
+ # dir="%s/%s/dv/%s/%s" % (root,show.slug,dt,loc.slug)
+ dir="%s/%s/jpg/%s/%s" % (root,show.slug,dt,loc.slug)
print dir
os.mkdir(dir)
View
5 dj/scripts/ocrdv.py
@@ -78,8 +78,9 @@ def ocrdv(dvfn,maxframes):
if score>2:
print "score", score
print titls
- return ocrtext
+ return ocrtext,image
frameno+=30*60 # bump on min
- return ''
+ image = stream.GetFrameNo(0)
+ return '',image
View
53 dj/scripts/sched.csv
@@ -1,29 +1,24 @@
-Date,Time,Room,title
-2009-07-25,10:30:00 AM,Auditorium,Opening Remarks
-2009-07-25,05:00:00 PM,Auditorium,Evening Lightning Talks
-2009-07-26,05:00:00 PM,Auditorium,Evening Lightning Talks
-2009-07-25,11:00:00 AM,Auditorium,#12 Getting Started With Django
-2009-07-25,11:00:00 AM,Classroom 1,#13 Coroutine Use In A Cavern Simulator
-2009-07-25,01:00:00 PM,Auditorium,#16 A Survey of Unit Testing Frameworks
-2009-07-25,01:00:00 PM,Classroom 1,#3 Python for Java Developers
-2009-07-25,01:00:00 PM,Classroom 2,#15 Teach Me Python
-2009-07-25,02:00:00 PM,Auditorium,#11 Show & Tell: IronPython Edition
-2009-07-25,02:00:00 PM,Classroom 1,#22 Operator Overloading and More
-2009-07-25,02:00:00 PM,Classroom 2,#5 Tutorial: Form-to-Database Web development
-2009-07-25,03:00:00 PM,Auditorium,#17 Python not harmful to CS majors (and good for everyone)
-2009-07-25,03:00:00 PM,Classroom 1,#8 Artificial Intelligence and Python: Developing a Conversational Interface Using Python
-2009-07-25,03:00:00 PM,Classroom 2,#5 Tutorial: Form-to-Database Web development (continued)
-2009-07-25,04:00:00 PM,Auditorium,#18 Game Development With Python and Pyglet
-2009-07-25,04:00:00 PM,Classroom 2,#5 Tutorial: Form-to-Database Web development (continued)
-2009-07-26,10:00:00 AM,Auditorium,#1 Django: After the Tutorial
-2009-07-26,10:00:00 AM,Classroom 1,#4 Python for Fun and Profit
-2009-07-26,10:00:00 AM,Classroom 2,#28 Oracle/Python/Linux Tutorial
-2009-07-26,11:00:00 AM,Auditorium,#14 There's nothing wrong with buildbot that a complete rewrite couldn't fix
-2009-07-26,11:00:00 AM,Classroom 1,#0 Clever uses for metaclasses
-2009-07-26,11:00:00 AM,Classroom 2,#28 Oracle/Python/Linux Tutorial (continued)
-2009-07-26,01:00:00 PM,Auditorium,#23 Deciding on a Python Web Technology Stack
-2009-07-26,01:00:00 PM,Classroom 1,#19 Dependency Injection in Python w/ snake-guice
-2009-07-26,02:00:00 PM,Auditorium,#20 Extending Plone using the Zope Component Architecture
-2009-07-26,02:00:00 PM,Classroom 1,#6 Inter-Process/Task Communication With Message Queues
-2009-07-26,03:00:00 PM,Auditorium,#10 Pumping Iron into Python: Intro to FePy
-2009-07-26,03:00:00 PM,Classroom 1,#21 Using Buildout to Develop and Deploy Python Projects
+Date,Time,Room,title,Link to talk,presenter(s),Link to Bio
+7/25/2009,10:30:00,Auditorium,Opening Remarks
+7/25/2009,11:00:00,Auditorium,#12 Getting Started With Django,http://www.pyohio.org/Talks#talk12,Alex Gaynor,http://www.pyohio.org/Presenters#presenter12
+7/25/2009,13:00:00,Auditorium,#3 Python for Java Developers,http://www.pyohio.org/Talks#talk3,Eric Floehr,http://www.pyohio.org/Presenters#presenter4
+7/25/2009,14:00:00,Auditorium,#22 Operator Overloading and More,http://www.pyohio.org/Talks#talk22,Neil Ludban,http://www.pyohio.org/Presenters#presenter22
+7/25/2009,15:00:00,Auditorium,#17 Python not harmful to CS majors (and good for everyone),http://www.pyohio.org/Talks#talk17,Bill Punch,http://www.cse.msu.edu/~punch/
+7/25/2009,16:00:00,Auditorium,#18 Game Development With Python and Pyglet,http://www.pyohio.org/Talks#talk18,Steve Johnson,http://www.pyohio.org/Presenters#presenter18
+7/25/2009,17:00:00,Auditorium,Evening Lightning Talks
+7/25/2009,11:00:00,Classroom 1,#13 Coroutine Use In A Cavern Simulator,http://www.pyohio.org/Talks#talk13,Jay Shaffstall,http://www.pyohio.org/Presenters#presenter13
+7/25/2009,15:00:00,Classroom 1,#8 Artificial Intelligence and Python: Developing a Conversational Interface Using Python,http://www.pyohio.org/Talks#talk8,Jerry Felix,http://www.pyohio.org/Presenters#Jerry_Felix
+7/25/2009,13:00:00,Classroom 1,#15 Teach Me Python,http://www.pyohio.org/Tutorials#tutorial15,David Felix
+7/25/2009,14:00:00,Classroom 2,#5 Tutorial: Form-to-Database Web development,http://www.pyohio.org/Tutorials#tutorial5,Gloria W. Jacobs,http://www.pyohio.org/Presenters#presenter5
+7/26/2009,10:00:00,Auditorium,#4 Python for Fun and Profit,http://www.pyohio.org/Talks#talk4,Eric Floehr,http://www.pyohio.org/Presenters#presenter4
+7/26/2009,11:00:00,Auditorium,#14 There's nothing wrong with buildbot that a complete rewrite couldn't fix,http://www.pyohio.org/Talks#talk14,C. Titus Brown,http://ivory.idyll.org/
+7/26/2009,13:00:00,Auditorium,#23 Deciding on a Python Web Technology Stack,http://www.pyohio.org/Talks#talk23,Mark Ramm-Christensen,http://www.pyohio.org/Presenters#presenter23
+7/26/2009,14:00:00,Auditorium,#20 Extending Plone using the Zope Component Architecture,http://www.pyohio.org/Talks#talk20,Calvin Hendryx-Parker,http://www.pyohio.org/Presenters#presenter20
+7/26/2009,15:00:00,Auditorium,#21 Using Buildout to Develop and Deploy Python Projects,http://www.pyohio.org/Talks#talk21,Clayton Parker,http://www.pyohio.org/Presenters#presenter21
+7/26/2009,16:00:00,Auditorium,#1 Django: After the Tutorial,http://www.pyohio.org/Talks#talk1,Joe Tyson,http://www.pyohio.org/Presenters#presenter1
+7/26/2009,17:00:00,Auditorium,Evening Lightning Talks
+7/26/2009,11:00:00,Classroom 1,#0 Clever uses for metaclasses,http://www.pyohio.org/Talks#talk0,Matt Wilson,http://www.pyohio.org/Presenters#presenter0
+7/26/2009,13:00:00,Classroom 1,#19 Dependency Injection in Python w/ snake-guice,http://www.pyohio.org/Talks#talk19,David Stanek,http://www.pyohio.org/Presenters#presenter19
+7/26/2009,14:00:00,Classroom 1,#6 Inter-Process/Task Communication With Message Queues,http://www.pyohio.org/Talks#talk6,William McVey,http://www.pyohio.org/Presenters#presenter6
+7/26/2009,16:00:00,Classroom 1,#16 A Survey of Unit Testing Frameworks,http://www.pyohio.org/Talks#talk16,John Szakmeister & Tim Woods
+7/26/2009,10:00:00,Classroom 2,#28 Oracle/Python/Linux Tutorial,http://www.pyohio.org/Tutorials#tutorial28,Gloria W. Jacobs,http://www.pyohio.org/Presenters#presenter5
View
3  dj/settings.py
@@ -10,7 +10,8 @@
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = '/home/juser/dev/veyepar/dj/vp.db' # Or path to database file if using sqlite3.
+# DATABASE_NAME = '/home/juser/dev/veyepar/dj/vp.db' # Or path to database file if using sqlite3.
+DATABASE_NAME = 'vp.db' # Or path to database file if using sqlite3.
DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = 'rootme' # Not used with sqlite3.
DATABASE_HOST = 'dell30' # Set to empty string for localhost. Not used with sqlite3.
View
4 dj/urls.py
@@ -23,3 +23,7 @@
(r'^databrowse/(.*)', databrowse.site.root),
(r'^main/', include('main.urls')),
)
+urlpatterns += patterns('',
+(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': '/home/carl/Videos/','show_indexes': True}))
+
View
BIN  sql/veyepar.mwb
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.