コード例 #1
0
ファイル: models.py プロジェクト: nijel/website
def purge_release(sender, instance, **kwargs):
    purge_cdn(
        # Pages with _littleboxes.html
        reverse('home'),
        reverse('news'),
        # Download lists
        reverse('files'),
        reverse('feed-files'),
        reverse('downloads'),
        # Version dumps
        '/downloads/list.txt',
        '/home_page/version.txt',
        '/home_page/version.js',
        '/home_page/version.json',
        '/downloads/phpMyAdmin-latest-all-languages.tar.bz2',
        '/downloads/phpMyAdmin-latest-all-languages.tar.gz',
        '/downloads/phpMyAdmin-latest-all-languages.tar.xz',
        '/downloads/phpMyAdmin-latest-all-languages.zip',
        '/downloads/phpMyAdmin-latest-english.tar.bz2',
        '/downloads/phpMyAdmin-latest-english.tar.gz',
        '/downloads/phpMyAdmin-latest-english.tar.xz',
        '/downloads/phpMyAdmin-latest-english.zip',
        reverse('doap'),
        reverse('pad'),
        # This release
        instance.get_absolute_url(),
    )
コード例 #2
0
def purge_release(sender, instance, **kwargs):
    if instance.purged:
        return
    instance.purged = True
    purge_cdn(
        # Pages with _littleboxes.html
        reverse('home'),
        reverse('news'),
        # Download lists
        reverse('files'),
        reverse('feed-files'),
        reverse('downloads'),
        # Version dumps
        '/downloads/list.txt',
        '/home_page/version.txt',
        '/home_page/version.js',
        '/home_page/version.json',
        '/downloads/phpMyAdmin-latest-all-languages.tar.bz2',
        '/downloads/phpMyAdmin-latest-all-languages.tar.gz',
        '/downloads/phpMyAdmin-latest-all-languages.tar.xz',
        '/downloads/phpMyAdmin-latest-all-languages.zip',
        '/downloads/phpMyAdmin-latest-english.tar.bz2',
        '/downloads/phpMyAdmin-latest-english.tar.gz',
        '/downloads/phpMyAdmin-latest-english.tar.xz',
        '/downloads/phpMyAdmin-latest-english.zip',
        '/downloads/phpMyAdmin-latest-source.tar.xz',
        reverse('doap'),
        reverse('pad'),
        # This release
        instance.get_absolute_url(),
    )
    # Purge all pages as every page contains download link
    purge_all_cdn()
コード例 #3
0
    def handle(self, *args, **options):
        handle = urllib.urlopen(URL)
        config = RawConfigParser(dict_type=MultiOrderedDict)
        try:
            config.readfp(handle)
        except:
            print("Failed to read the version configuration file. ")
            print("Check the status of " + URL)
            import sys
            sys.exit(1)

        master = config.get('demo', 'master-release')[0]

        modified = False

        processed = set()

        for version in config.get('demo', 'branches[]'):
            demo, created = Demo.objects.get_or_create(
                name=version, defaults={'master_version': master})
            modified |= created
            if not created and demo.master_version != master:
                demo.master_version = master
                demo.save()
                modified = True

            processed.add(demo.id)

        Demo.objects.exclude(id__in=processed).delete()

        if modified:
            purge_cdn(reverse('try'))
コード例 #4
0
ファイル: fetch_versions.py プロジェクト: nijel/website
    def handle(self, *args, **options):
        handle = urllib.urlopen(URL)
        config = RawConfigParser(dict_type=MultiOrderedDict)
        config.readfp(handle)

        master = config.get('demo', 'master-release')[0]

        modified = False

        processed = set()

        for version in config.get('demo', 'branches[]'):
            demo, created = Demo.objects.get_or_create(
                name=version,
                defaults={'master_version': master}
            )
            modified |= created
            if not created and demo.master_version != master:
                demo.master_version = master
                demo.save()
                modified = True

            processed.add(demo.id)

        Demo.objects.exclude(id__in=processed).delete()

        if modified:
            purge_cdn(reverse('try'))
コード例 #5
0
ファイル: models.py プロジェクト: rajakedia1/website
def purge_post(sender, instance, **kwargs):
    num_pages = 1 + (Post.objects.count() / 10)
    pages = [
        reverse('home'),
        reverse('news'),
        reverse('feed-news'),
        instance.get_absolute_url(),
    ]
    pages.extend([
        reverse('news-page', kwargs={'page': x + 1}) for x in range(num_pages)
    ])
    purge_cdn(*pages)
コード例 #6
0
ファイル: models.py プロジェクト: 007durgesh219/website
def purge_post(sender, instance, **kwargs):
    num_pages = 1 + (Post.objects.count() / 10)
    pages = [
        reverse('home'),
        reverse('news'),
        reverse('feed-news'),
        instance.get_absolute_url(),
    ]
    pages.extend([
        reverse('news-page', kwargs={'page': x + 1})
        for x in range(num_pages)
    ])
    purge_cdn(*pages)
コード例 #7
0
ファイル: models.py プロジェクト: 007durgesh219/website
def purge_planet(sender, instance, **kwargs):
    purge_cdn(reverse('home'))
コード例 #8
0
def purge_theme(sender, instance, **kwargs):
    purge_cdn(reverse('themes'))
コード例 #9
0
ファイル: models.py プロジェクト: ImgBotApp/website-30
def purge_pmasa(sender, instance, **kwargs):
    purge_cdn(
        reverse('security'),
        reverse('feed-security'),
        instance.get_absolute_url(),
    )
コード例 #10
0
ファイル: models.py プロジェクト: nijel/website
def purge_theme(sender, instance, **kwargs):
    purge_cdn(reverse('themes'))
コード例 #11
0
ファイル: models.py プロジェクト: hinoue-work/website
def purge_pmasa(sender, instance, **kwargs):
    purge_cdn(reverse("security"), reverse("feed-security"), instance.get_absolute_url())
コード例 #12
0
ファイル: models.py プロジェクト: rajakedia1/website
def purge_planet(sender, instance, **kwargs):
    purge_cdn(reverse('home'))