~canonical-django/canonical-django/project-template

« back to all changes in this revision

Viewing changes to trunk/python-packages/django/contrib/sitemaps/management/commands/ping_google.py

  • Committer: Matthew Nuzum
  • Date: 2008-11-13 05:46:03 UTC
  • Revision ID: matthew.nuzum@canonical.com-20081113054603-v0kvr6z6xyexvqt3
adding to version control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.core.management.base import BaseCommand
 
2
from django.contrib.sitemaps import ping_google
 
3
 
 
4
 
 
5
class Command(BaseCommand):
 
6
    help = "Ping google with an updated sitemap, pass optional url of sitemap"
 
7
 
 
8
    def execute(self, *args, **options):
 
9
        if len(args) == 1:
 
10
            sitemap_url = args[0]
 
11
        else:
 
12
            sitemap_url = None
 
13
        ping_google(sitemap_url=sitemap_url)
 
14