Skip to content

Commit

Permalink
osdc schedule consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlFK committed Oct 28, 2015
1 parent 97f101d commit d349f6b
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 11 deletions.
3 changes: 0 additions & 3 deletions INSTALL.sh
Expand Up @@ -92,9 +92,6 @@ ln -s /usr/lib/python2.7/dist-packages/gi
git clone https://github.com/dabodev/dabo.git dabo-master
ln -s dabo-master/dabo

# force latest six
pip uninstall six -y; pip install six

# to hookinto local open-cv
# python -c "import cv2;print cv2.__file__"
# /usr/lib/python2.7/dist-packages/cv2.so
Expand Down
2 changes: 1 addition & 1 deletion dj/main/views.py
Expand Up @@ -221,7 +221,7 @@ def eps_xfer(request,client_slug=None,show_slug=None):
'start', 'duration',
'released', 'license', 'tags',
'conf_key', 'conf_url',
'host_url', 'public_url', 'rax_mp4_url',
'host_url', 'public_url', 'rax_mp4_url', 'archive_mp4_url',
'twitter_url',
'comment',
]
Expand Down
61 changes: 56 additions & 5 deletions dj/scripts/addeps.py
Expand Up @@ -463,11 +463,13 @@ def add_eps(self, schedule, show):
print


"""
if diff and episode.state > 5: # add_to_richard
print(u"not updating conf_key: {conf_key}, name:{name}".format(**row))
print(episode.public_url)
print()
continue
"""

if self.options.update and diff:
if episode is None:
Expand Down Expand Up @@ -2743,7 +2745,59 @@ def nodevember14(self,schedule,show):
return

def osdc2015(self, schedule, show):
return self.djbp10(schedule, show)

schedule = schedule['schedule']
schedule = [s for s in schedule if 'authors' in s]
schedule = [s for s in schedule if s['rooms']]

field_maps = [
('room','location'),
('name','name'),
('description','description'),
('authors','authors'),
('authors','emails'),
('start','start'),
('duration','duration'),
('released','released'),
('license','license'),
('tags','tags'),
('conf_key','conf_key'),
('conf_url','conf_url'),
('','twitter_id'),
('','host_url'),
('','public_url'),
]

events = self.generic_events(schedule, field_maps)
rooms = self.get_rooms(events)
self.add_rooms(rooms,show)

# for event in events:
# pprint.pprint( event )

# remove events with no room (like Break)
events = [e for e in events if e['location'] is not None ]
events = [e for e in events if e['location'] is not None ]

for event in events:
pprint.pprint( event )

if "Derwent 1" in event['location']:
event['location'] = 'Derwent 1'

event['start'] = datetime.datetime.strptime(
event['start'], '%Y-%m-%dT%H:%M:%S' )

event['duration'] = "00:{}:00".format(event['duration'])

event['authors']=', '.join(event['authors'])
event['emails']=', '.join(event['emails'])

event['tags'] = ''

self.add_eps(events, show)

return

def djbp10(self, schedule, show):

Expand Down Expand Up @@ -3011,10 +3065,7 @@ def one_show(self, show):

# auth stuff goes here, kinda.

try:
auth = pw.addeps.get(self.options.client, None)
except:
auth = None
auth = pw.addeps.get(self.options.client, None)

if auth is not None:
if self.options.verbose: print auth
Expand Down
4 changes: 2 additions & 2 deletions setup/requirements.txt
Expand Up @@ -12,7 +12,7 @@ python-dateutil

progressbar

# boto
boto
internetarchive

requests
Expand Down Expand Up @@ -46,8 +46,8 @@ git+https://github.com/CarlFK/google-api-python-client.git#egg=googleapiclient
# for util/dirmon.py
git+https://github.com/maliubiao/python_inotify.git

six
python-keystoneclient
oslo.utils
oslo.serialization
boto
beautifulsoup4

0 comments on commit d349f6b

Please sign in to comment.