Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first half of lynard import

  • Loading branch information...
commit 24574e9412fc7519d3e3d9928061f39686fe7478 1 parent b7c86aa
@CarlFK authored
View
3  .gitignore
@@ -17,4 +17,5 @@ veyepar.db
*.gif
*.pdf
*.jpg
-venv/
+venv/
+
View
4 dj/main/admin.py
@@ -48,7 +48,7 @@ def state_bumper(self,obj):
list_display = ('id',
'name', 'state',
- 'public_url',
+ 'conf_url',
)
@@ -65,7 +65,7 @@ def state_bumper(self,obj):
# 'locked','locked_by', )
# list_editable = ('state','duration')
admin_order_field = ('sequence', 'name',)
- list_filter = ('state','location','locked','locked_by', 'show')
+ list_filter = ('state','location','locked','locked_by', 'show', 'released')
search_fields = ['name']
prepopulated_fields = {"slug": ("name",)}
save_on_top=True
View
3  dj/main/templates/episode.html
@@ -5,11 +5,12 @@
<title>veyepar: {{episode.name}}</title>
{% endblock %}
+{% block content %}
<script>
$(function() {
$( "#accordian").accordian();
});
-{% block content %}
+</script>
<a href="{% url client client.slug %}">{{ client.name }}</a>
<a href="{% url episode_list client.slug show.slug%}">{{ show.name }}</a>
View
4 dj/main/views.py
@@ -1009,8 +1009,8 @@ def episode(request, episode_no):
# chaps starts at 0, add the end also.
chaps.append(chap)
- chaps = [ "%s:%s:%s" %
- (seconds//3600, (seconds%3600)//60, seconds%60)
+ chaps = [ (int(seconds*29.27), "%s:%s:%s" %
+ (seconds//3600, (seconds%3600)//60, seconds%60) )
for seconds in chaps]
clrfFormSet = formset_factory(clrfForm, extra=0)
View
100 dj/scripts/addeps.py
@@ -1084,7 +1084,6 @@ def scipy_v1(self, schedule, show):
rooms.sort()
self.add_rooms(rooms,show)
- # return self.dump_keys(schedule)
events = self.scipy_events(schedule)
self.add_eps(events, show)
return
@@ -1517,6 +1516,60 @@ def pyconca2012(self,schedule,show):
return
+ def lanyrd(self, schedule, show):
+ # http://lanyrd.com
+ field_maps = [
+ ('id','id'),
+ # ('','location'),
+ # ('','sequence'),
+ ('title','name'),
+ ('speakers','authors'),
+ # ('','emails'),
+ ('abstract','description'),
+ ('start_time','start'),
+ ('end_time','end'),
+ # ('','duration'),
+ # ('','released'),
+ # ('','license'),
+ # ('','tags'),
+ ('id','conf_key'),
+ ('web_url','conf_url'),
+ # ('','host_url'),
+ # ('','publiv_url'),
+ ]
+
+
+ events =[]
+ for day in schedule['sessions']:
+ pprint.pprint(day)
+ events += self.generic_events(day['sessions'], field_maps)
+ # for session in day['sessions']:
+ #[u'speakers', u'title', u'event_id', u'start_time', u'space', u'topics', u'times', u'abstract', u'web_url', u'end_time', u'id', u'day']
+
+ rooms = ['room_1']
+ self.add_rooms(rooms,show)
+
+ # pprint.pprint(events[-2])
+ for event in events:
+
+ event['authors'] = ", ".join(
+ a['name'] for a in event['authors'])
+
+ event['start'] = datetime.datetime.strptime(
+ event['start'],'%Y-%m-%d %H:%M:%S')
+ event['end'] = datetime.datetime.strptime(
+ event['end'],'%Y-%m-%d %H:%M:%S')
+ delta = end_dt - start_dt
+ minutes = delta.seconds/60
+ event['duration'] = "00:%s:00" % ( minutes)
+
+ # not done, more needed here.
+
+
+ self.add_eps(events, show)
+
+ return
+
def symposion2(self, schedule, show):
# pycon.us 2013
@@ -1759,6 +1812,8 @@ def one_show(self, show):
'pyconca2012': 'http://pycon.ca/talk.json',
'lca2013': 'http://lca2013.linux.org.au/programme/schedule/json',
'pycon2013': 'https://us.pycon.org/2013/schedule/conference.json',
+ 'write_the_docs_2013': 'file://schedules/writethedocs.json',
+ # 'write_the_docs_2013': 'http://lanyrd.com/2013/writethedocs/schedule/ad9911ddf35b5f0e.v1.json',
}[self.options.show]
payload = None
@@ -1768,10 +1823,10 @@ def one_show(self, show):
# kinda broke this
# nees to be meld in with the response object
f = open(url[7:])
- j = json.load(f)
- pprint.pprint(j)
- self.veyepar(j, show)
- return
+ schedule = json.load(f)
+ # pprint.pprint(j)
+ # self.veyepar(j, show)
+ # return
else:
session = requests.session()
@@ -1784,21 +1839,21 @@ def one_show(self, show):
response = session.get(url, params=payload, )
- if url[-4:]=='.csv':
- schedule = list(csv.reader(f))
- if 'desktopsummit.org' in url:
- return self.desktopsummit(schedule,show)
- elif url[-4:]=='.xml':
- import xml.etree.ElementTree
- x = response.read()
- schedule=xml.etree.ElementTree.XML(x)
- return self.fosdem2012(schedule,show)
- else:
- j = response.text
- schedule = response.json
- # schedule = response.json()
- # if it is a python prety printed list:
- # schedule = eval(j)
+ if url[-4:]=='.csv':
+ schedule = list(csv.reader(f))
+ if 'desktopsummit.org' in url:
+ return self.desktopsummit(schedule,show)
+ elif url[-4:]=='.xml':
+ import xml.etree.ElementTree
+ x = response.read()
+ schedule=xml.etree.ElementTree.XML(x)
+ return self.fosdem2012(schedule,show)
+ else:
+ j = response.text
+ schedule = response.json
+ # schedule = response.json()
+ # if it is a python prety printed list:
+ # schedule = eval(j)
# save for later
# file('schedule.json','w').write(j)
@@ -1811,10 +1866,14 @@ def one_show(self, show):
# look at fingerprint of file, (or cheat and use the showname)
# call appropiate parser
+ if self.options.show =='write_the_docs_2013':
+ return self.lanyrd(schedule,show)
+
if url.endswith("/schedule/conference.json"):
# this is Ver pycon2013
return self.pycon2013(schedule,show)
+
if self.options.show =='pyconca2012':
return self.pyconca2012(schedule,show)
@@ -1826,7 +1885,6 @@ def one_show(self, show):
if url.endswith(".sched.org/api/session/export"):
# Sched.org Conference Mobcaile Apps
# Chicago Web Conf 2012
- # return self.dump_keys(schedule)
return self.sched(schedule,show)
if self.options.show == 'pyohio_2012':
View
2  dj/scripts/post_yt.py
@@ -158,7 +158,7 @@ def process_ep(self, ep):
# down to next layer of code that will do the uplaading
youtube_success = uploader.upload()
- ep.comment += "\n%s\n" % (uploader.ret_text.decode('utf-8').encode('ascii', 'xmlcharrefreplace'))
+ # ep.comment += "\n%s\n" % (uploader.ret_text.decode('utf-8').encode('ascii', 'xmlcharrefreplace'))
# self.log_info(uploader.ret_text)
View
3  dj/scripts/tweet.py
@@ -81,7 +81,8 @@ def process_ep(self, ep):
# url="http://nextdayvideo.blip.tv/file/%s" % ep.host_url
url = ep.public_url
- prefix = "#%s #VIDEO" % show.slug
+ # prefix = "#%s #VIDEO" % show.slug
+ prefix = "#%s" % show.slug
tweet = self.mk_tweet(prefix, ep.name, ep.authors, url)
ret=self.tweet_tweet(user, tweet)
Please sign in to comment.
Something went wrong with that request. Please try again.