<commit_before>from django.db import models
from django.utils.translation import ugettext as _
from cms.models import CMSPlugin
import settings

SECURE_SRC = ("http://secure.vimeo.com/moogaloop.swf?clip_id=%(video_id)d&amp;server=secure.vimeo.com&amp;"
              "title=%(title)d&amp;byline=%(byline)d&amp;portrait=%(portrait)d"
              "&amp;color=%(color)s&amp;fullscreen=1&amp;autoplay=%(autoplay)d&amp;loop=%(loop)d")
PLAYER_SRC = ("http://player.vimeo.com/video/%(video_id)d?color=%(color)s&amp;byline=%(byline)d&portrait=%(portrait)"
              "d&title=%(title)d&autoplay=%(autoplay)d&loop=%(loop)d")

class VimeoSecure(CMSPlugin):
    video_id = models.PositiveIntegerField(_('Video id'), 
        help_text=_('e.g http://vimeo.com/15189756'),
        max_length=60)
    color = models.CharField(default=settings.VIMEOSECURE_COLOR, max_length=6)    
    width = models.IntegerField(default=settings.VIMEOSECURE_WIDTH)
    height = models.IntegerField(default=settings.VIMEOSECURE_HEIGHT)
    title = models.BooleanField(default=settings.VIMEOSECURE_TITLE)
    portrait = models.BooleanField(default=settings.VIMEOSECURE_PORTRAIT)
    byline = models.BooleanField(default=settings.VIMEOSECURE_BYLINE)
    autoplay = models.BooleanField(_('Autoplay this video'), default=settings.VIMEOSECURE_AUTOPLAY)
    loop = models.BooleanField(_('Loop this video.'), default=settings.VIMEOSECURE_LOOP)    
    secure = models.BooleanField(default=settings.VIMEOSECURE_SECURE,
        help_text=_('Show video over HTTPS.'))

    def __unicode__(self):
        return u'<a href="http://vimeo.com/%(video_id)d">http://vimeo.com/%(video_id)d</a>' % {'video_id': self.video_id}
    __unicode__.allow_tags = True

    @property
    def src(self):
        if self.secure:
            return SECURE_SRC % self.__dict__        <commit_msg>added https<commit_after>from django.db import models
from django.utils.translation import ugettext as _
from cms.models import CMSPlugin
import settings

SECURE_SRC = ("https://secure.vimeo.com/moogaloop.swf?clip_id=%(video_id)d&amp;server=secure.vimeo.com&amp;"
              "title=%(title)d&amp;byline=%(byline)d&amp;portrait=%(portrait)d"
              "&amp;color=%(color)s&amp;fullscreen=1&amp;autoplay=%(autoplay)d&amp;loop=%(loop)d")
PLAYER_SRC = ("http://player.vimeo.com/video/%(video_id)d?color=%(color)s&amp;byline=%(byline)d&portrait=%(portrait)"
              "d&title=%(title)d&autoplay=%(autoplay)d&loop=%(loop)d")

class VimeoSecure(CMSPlugin):
    video_id = models.PositiveIntegerField(_('Video id'), 
        help_text=_('e.g http://vimeo.com/15189756'),
        max_length=60)
    color = models.CharField(default=settings.VIMEOSECURE_COLOR, max_length=6)    
    width = models.IntegerField(default=settings.VIMEOSECURE_WIDTH)
    height = models.IntegerField(default=settings.VIMEOSECURE_HEIGHT)
    title = models.BooleanField(default=settings.VIMEOSECURE_TITLE)
    portrait = models.BooleanField(default=settings.VIMEOSECURE_PORTRAIT)
    byline = models.BooleanField(default=settings.VIMEOSECURE_BYLINE)
    autoplay = models.BooleanField(_('Autoplay this video'), default=settings.VIMEOSECURE_AUTOPLAY)
    loop = models.BooleanField(_('Loop this video.'), default=settings.VIMEOSECURE_LOOP)    
    secure = models.BooleanField(default=settings.VIMEOSECURE_SECURE,
        help_text=_('Show video over HTTPS.'))

    def __unicode__(self):
        return u'<a href="http://vimeo.com/%(video_id)d">http://vimeo.com/%(video_id)d</a>' % {'video_id': self.video_id}
    __unicode__.allow_tags = True

    @property
    def src(self):
        if self.secure:
            return SECURE_SRC % self.__dict__        
{'fraction_non_alphanumeric': 0.14421768707482993, 'fraction_numerical': 0.006530612244897959, 'mean_word_length': 4.74375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6488319', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1289, 'n_words': 153}