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(), )
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()
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'))
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'))
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)
def purge_planet(sender, instance, **kwargs): purge_cdn(reverse('home'))
def purge_theme(sender, instance, **kwargs): purge_cdn(reverse('themes'))
def purge_pmasa(sender, instance, **kwargs): purge_cdn( reverse('security'), reverse('feed-security'), instance.get_absolute_url(), )
def purge_pmasa(sender, instance, **kwargs): purge_cdn(reverse("security"), reverse("feed-security"), instance.get_absolute_url())