def video_ingest(request, job_id): job = get_object_or_404(TranscodeJob, pk=int(job_id)) job_data = {'title': job.title, 'creator': (job.user.get_full_name() or job.user.username), 'type': 'video', 'language': 'eng', 'date': datetime.date.today() } form = DublinCoreForm(job_data) if request.method == 'POST': form = DublinCoreForm(request.POST) if form.is_valid(): Video.objects.create(user=job.user.username, raw=job.raw.url, raw_info=job.info, mp4=job.mp4.url, ogv=job.ogv.url, thumbnail=job.thumbnail.url, dc=form.cleaned_data) job.delete() return redirect(reverse('rtv:queue')) context = {'rtv_version': rtv.get_version(), 'title': 'This is the rtv ingest page', 'form': form } return render_to_response('rtv/video_ingest.html', context, RequestContext(request))
def video_ingest(request, job_id): job = get_object_or_404(TranscodeJob, pk=int(job_id)) job_data = { 'title': job.title, 'creator': (job.user.get_full_name() or job.user.username), 'type': 'video', 'language': 'eng', 'date': datetime.date.today() } form = DublinCoreForm(job_data) if request.method == 'POST': form = DublinCoreForm(request.POST) if form.is_valid(): Video.objects.create(user=job.user.username, raw=job.raw.url, raw_info=job.info, mp4=job.mp4.url, ogv=job.ogv.url, thumbnail=job.thumbnail.url, dc=form.cleaned_data) job.delete() return redirect(reverse('rtv:queue')) context = { 'rtv_version': rtv.get_version(), 'title': 'This is the rtv ingest page', 'form': form } return render_to_response('rtv/video_ingest.html', context, RequestContext(request))
def video_list(request): videos = Video.objects.all() context = {'rtv_version': rtv.get_version(), 'title': 'This is the rtv video list page', 'object_list': videos } return render_to_response('rtv/video_list.html', context, RequestContext(request))
def video_list(request): videos = Video.objects.all() context = { 'rtv_version': rtv.get_version(), 'title': 'This is the rtv video list page', 'object_list': videos } return render_to_response('rtv/video_list.html', context, RequestContext(request))
def video_detail(request, pid): try: video = Video.objects.get(pid=pid) except ObjectNotFoundError: raise Http404 context = {'rtv_version': rtv.get_version(), 'title': 'This is the rtv video detail page', 'object': video } return render_to_response('rtv/video_detail.html', context, RequestContext(request))
def info(request): """ Shows a list of jobs that are in progress, or have been completed. Links to individual jobs ingest view. """ context = {'jobs': TranscodeJob.objects.all(), 'vids': TranscodeJob.objects.all(), 'rtv_version': rtv.get_version(), 'title': 'This is the rtv info page' } return render_to_response('rtv/info.html', context, RequestContext(request))
def video_detail(request, pid): try: video = Video.objects.get(pid=pid) except ObjectNotFoundError: raise Http404 context = { 'rtv_version': rtv.get_version(), 'title': 'This is the rtv video detail page', 'object': video } return render_to_response('rtv/video_detail.html', context, RequestContext(request))
def demo(request): all = Video.objects.all() if all: latest = all[-1] else: latest = None return render_to_response('rtv/demo.html', {'rtv_version': rtv.get_version(),'title': "This is the rtv demo page", 'vid': latest, 'all': all}, RequestContext(request))
def info(request): """ Shows a list of jobs that are in progress, or have been completed. Links to individual jobs ingest view. """ context = { 'jobs': TranscodeJob.objects.all(), 'vids': TranscodeJob.objects.all(), 'rtv_version': rtv.get_version(), 'title': 'This is the rtv info page' } return render_to_response('rtv/info.html', context, RequestContext(request))
def demo(request): all = Video.objects.all() if all: latest = all[-1] else: latest = None return render_to_response( 'rtv/demo.html', { 'rtv_version': rtv.get_version(), 'title': "This is the rtv demo page", 'vid': latest, 'all': all }, RequestContext(request))
def video_update(request, pid): video = Video.objects.get(pid=pid) form = DublinCoreForm(video.dc_as_dict()) if request.method == 'POST': form = DublinCoreForm(request.POST) if form.is_valid(): video.dict_to_dc(form.cleaned_data) return redirect(reverse('rtv:video_list')) context = {'rtv_version': rtv.get_version(), 'title': 'This is the rtv ingest page', 'form': form } return render_to_response('rtv/video_update.html', context, RequestContext(request))
def video_update(request, pid): video = Video.objects.get(pid=pid) form = DublinCoreForm(video.dc_as_dict()) if request.method == 'POST': form = DublinCoreForm(request.POST) if form.is_valid(): video.dict_to_dc(form.cleaned_data) return redirect(reverse('rtv:video_list')) context = { 'rtv_version': rtv.get_version(), 'title': 'This is the rtv ingest page', 'form': form } return render_to_response('rtv/video_update.html', context, RequestContext(request))
def upload(request): form = TranscodeJobForm() if request.method == 'POST': form = TranscodeJobForm(request.POST, request.FILES) if form.is_valid(): vals = form.cleaned_data file = vals.pop('raw') vals['user'] = list(User.objects.all())[0] job = TranscodeJob.objects.create(**vals) basename, ext = os.path.splitext(os.path.basename(file.name)) job.raw.save(basename+'_source'+ext, file, save=True) job.set_info() return redirect(reverse('rtv:queue')) context = { 'rtv_version': rtv.get_version(), 'title': "This is the rtv upload page", 'form': form } return render_to_response('rtv/upload.html', context , RequestContext(request))
def upload(request): form = TranscodeJobForm() if request.method == 'POST': form = TranscodeJobForm(request.POST, request.FILES) if form.is_valid(): vals = form.cleaned_data file = vals.pop('raw') vals['user'] = list(User.objects.all())[0] job = TranscodeJob.objects.create(**vals) basename, ext = os.path.splitext(os.path.basename(file.name)) job.raw.save(basename + '_source' + ext, file, save=True) job.set_info() return redirect(reverse('rtv:queue')) context = { 'rtv_version': rtv.get_version(), 'title': "This is the rtv upload page", 'form': form } return render_to_response('rtv/upload.html', context, RequestContext(request))
#source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'rtv' copyright = u'2010, Owen Nelson, Connor McCampbell' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # import rtv release = rtv.get_version() # The full version, including alpha/beta/rc tags. if 'SVN' in release: version = 'Dev' else: version = '.'.join(release[:2]) # The short X.Y version. # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y'
if dirname.startswith('.'): del dirnames[i] if '__init__.py' in filenames: packages.append('.'.join(fullsplit(dirpath))) elif filenames: data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) # Small hack for working with bdist_wininst. # See http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst': for file_info in data_files: file_info[0] = '\\PURELIB\\%s' % file_info[0] #sys.path.insert(0,os.path.abspath(os.path.dirname(__file__)) import rtv setup( name = "django-rtv", version = rtv.get_version(), classifiers =[ 'Development Status :: 1 - Planning', 'Framework :: Django', ], # url = '', # license = '', description = "", author = 'Owen Nelson', author_email = '*****@*****.**', packages = packages, data_files = data_files, )