We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add support for Google feedburner
Hi all,

Do you have any plan to add support for [Google feedburner](http://feedburner.google.com/)? It is very useful to track feed subscribers, provide a HTMLized feed page and so on. To use this, Pelican need to show a feedburner's address to visitors while providing a feed to the feedburner as before.

Regards.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `samples/pelican.conf.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 AUTHOR = u'Alexis Métaireau'
3 SITENAME = u"Alexis' log"
4 SITEURL = 'http://blog.notmyidea.org'
5 TIMEZONE = "Europe/Paris"
6 
7 GITHUB_URL = 'http://github.com/ametaireau/'
8 DISQUS_SITENAME = "blog-notmyidea"
9 PDF_GENERATOR = False
10 REVERSE_CATEGORY_ORDER = True
11 LOCALE = ""
12 DEFAULT_PAGINATION = 4
13 
14 FEED_RSS = 'feeds/all.rss.xml'
15 CATEGORY_FEED_RSS = 'feeds/%s.rss.xml'
16 
17 LINKS = (('Biologeek', 'http://biologeek.org'),
18          ('Filyb', "http://filyb.info/"),
19          ('Libert-fr', "http://www.libert-fr.com"),
20          ('N1k0', "http://prendreuncafe.com/blog/"),
21          (u'Tarek Ziadé', "http://ziade.org/blog"),
22          ('Zubin Mithra', "http://zubin71.wordpress.com/"),)
23 
24 SOCIAL = (('twitter', 'http://twitter.com/ametaireau'),
25           ('lastfm', 'http://lastfm.com/user/akounet'),
26           ('github', 'http://github.com/ametaireau'),)
27 
28 # global metadata to all the contents
29 DEFAULT_METADATA = (('yeah', 'it is'),)
30 
31 # static paths will be copied under the same name
32 STATIC_PATHS = ["pictures",]
33 
34 # A list of files to copy from the source to the destination
35 FILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),)
36 
37 # foobar will not be used, because it's not in caps. All configuration keys
38 # have to be in caps
39 foobar = "barbaz"
40 
41
```

Path: `pelican/settings.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 import os
3 import locale
4 import logging
5 
6 from os.path import isabs
7 
8 
9 logger = logging.getLogger(__name__)
10 
11 
12 DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
13                               "themes/notmyidea"])
14 _DEFAULT_CONFIG = {'PATH': None,
15                    'ARTICLE_DIR': '',
16                    'ARTICLE_EXCLUDES': ('pages',),
17                    'PAGE_DIR': 'pages',
18                    'PAGE_EXCLUDES': (),
19                    'THEME': DEFAULT_THEME,
20                    'OUTPUT_PATH': 'output/',
21                    'MARKUP': ('rst', 'md'),
22                    'STATIC_PATHS': ['images', ],
23                    'THEME_STATIC_PATHS': ['static', ],
24                    'FEED': 'feeds/all.atom.xml',
25                    'CATEGORY_FEED': 'feeds/%s.atom.xml',
26                    'TRANSLATION_FEED': 'feeds/all-%s.atom.xml',
27                    'FEED_MAX_ITEMS': '',
28                    'SITENAME': 'A Pelican Blog',
29                    'DISPLAY_PAGES_ON_MENU': True,
30                    'PDF_GENERATOR': False,
31                    'DEFAULT_CATEGORY': 'misc',
32                    'FALLBACK_ON_FS_DATE': True,
33                    'WITH_FUTURE_DATES': True,
34                    'CSS_FILE': 'main.css',
35                    'REVERSE_ARCHIVE_ORDER': False,
36                    'REVERSE_CATEGORY_ORDER': False,
37                    'DELETE_OUTPUT_DIRECTORY': False,
38                    'ARTICLE_URL': '{slug}.html',
39                    'ARTICLE_SAVE_AS': '{slug}.html',
40                    'ARTICLE_LANG_URL': '{slug}-{lang}.html',
41                    'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html',
42                    'PAGE_URL': 'pages/{slug}.html',
43                    'PAGE_SAVE_AS': 'pages/{slug}.html',
44                    'PAGE_LANG_URL': 'pages/{slug}-{lang}.html',
45                    'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html',
46                    'CATEGORY_URL': 'category/{name}.html',
47                    'CATEGORY_SAVE_AS': 'category/{name}.html',
48                    'TAG_URL': 'tag/{slug}.html',
49                    'TAG_SAVE_AS': 'tag/{slug}.html',
50                    'AUTHOR_URL': u'author/{slug}.html',
51                    'AUTHOR_SAVE_AS': u'author/{slug}.html',
52                    'RELATIVE_URLS': True,
53                    'DEFAULT_LANG': 'en',
54                    'TAG_CLOUD_STEPS': 4,
55                    'TAG_CLOUD_MAX_ITEMS': 100,
56                    'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'archives'),
57                    'PAGINATED_DIRECT_TEMPLATES': ('index', ),
58                    'PELICAN_CLASS': 'pelican.Pelican',
59                    'DEFAULT_DATE_FORMAT': '%a %d %B %Y',
60                    'DATE_FORMATS': {},
61                    'JINJA_EXTENSIONS': [],
62                    'LOCALE': '',  # default to user locale
63                    'DEFAULT_PAGINATION': False,
64                    'DEFAULT_ORPHANS': 0,
65                    'DEFAULT_METADATA': (),
66                    'FILES_TO_COPY': (),
67                    'DEFAULT_STATUS': 'published',
68                    'ARTICLE_PERMALINK_STRUCTURE': '',
69                    'TYPOGRIFY': False,
70                    }
71 
72 
73 def read_settings(filename=None):
74     """Load a Python file into a dictionary.
75     """
76     context = _DEFAULT_CONFIG.copy()
77     if filename:
78         tempdict = {}
79         execfile(filename, tempdict)
80         for key in tempdict:
81             if key.isupper():
82                 context[key] = tempdict[key]
83 
84         # Make the paths relative to the settings file
85         for path in ['PATH', 'OUTPUT_PATH']:
86             if path in context:
87                 if context[path] is not None and not isabs(context[path]):
88                     context[path] = os.path.abspath(os.path.normpath(
89                         os.path.join(os.path.dirname(filename), context[path]))
90                     )
91 
92     # if locales is not a list, make it one
93     locales = context['LOCALE']
94 
95     if isinstance(locales, basestring):
96         locales = [locales]
97 
98     # try to set the different locales, fallback on the default.
99     if not locales:
100         locales = _DEFAULT_CONFIG['LOCALE']
101 
102     for locale_ in locales:
103         try:
104             locale.setlocale(locale.LC_ALL, locale_)
105             break  # break if it is successfull
106         except locale.Error:
107             pass
108     else:
109         logger.warn("LOCALE option doesn't contain a correct value")
110 
111     if not 'TIMEZONE' in context:
112         logger.warn("No timezone information specified in the settings. Assuming"
113                  " your timezone is UTC for feed generation. Check "
114                  "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone "
115                  "for more information")
116 
117     # set the locale
118     return context
119
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pelican/settings.py b/pelican/settings.py
--- a/pelican/settings.py
+++ b/pelican/settings.py
@@ -22,6 +22,7 @@
                    'STATIC_PATHS': ['images', ],
                    'THEME_STATIC_PATHS': ['static', ],
                    'FEED': 'feeds/all.atom.xml',
+                   'FEED_MAIN_URL': 'feeds/all.atom.xml',
                    'CATEGORY_FEED': 'feeds/%s.atom.xml',
                    'TRANSLATION_FEED': 'feeds/all-%s.atom.xml',
                    'FEED_MAX_ITEMS': '',
@@ -71,26 +72,45 @@
 
 
 def read_settings(filename=None):
+    if filename:
+        local_settings = get_settings_from_file(filename)
+    else:
+        local_settings = _DEFAULT_CONFIG
+    configured_settings = configure_settings(local_settings, None, filename)
+    return configured_settings
+
+
+def get_settings_from_file(filename, default_settings=None):
     """Load a Python file into a dictionary.
     """
-    context = _DEFAULT_CONFIG.copy()
+    if default_settings == None:
+        default_settings = _DEFAULT_CONFIG
+    context = default_settings.copy()
     if filename:
         tempdict = {}
         execfile(filename, tempdict)
         for key in tempdict:
             if key.isupper():
                 context[key] = tempdict[key]
+    return context
+
 
-        # Make the paths relative to the settings file
+def configure_settings(settings, default_settings=None, filename=None):
+    """Provide optimizations, error checking, and warnings for loaded settings"""
+    if default_settings is None:
+        default_settings = _DEFAULT_CONFIG
+
+    # Make the paths relative to the settings file
+    if filename:
         for path in ['PATH', 'OUTPUT_PATH']:
-            if path in context:
-                if context[path] is not None and not isabs(context[path]):
-                    context[path] = os.path.abspath(os.path.normpath(
-                        os.path.join(os.path.dirname(filename), context[path]))
+            if path in settings:
+                if settings[path] is not None and not isabs(settings[path]):
+                    settings[path] = os.path.abspath(os.path.normpath(
+                        os.path.join(os.path.dirname(filename), settings[path]))
                     )
 
     # if locales is not a list, make it one
-    locales = context['LOCALE']
+    locales = settings['LOCALE']
 
     if isinstance(locales, basestring):
         locales = [locales]
@@ -108,11 +128,20 @@
     else:
         logger.warn("LOCALE option doesn't contain a correct value")
 
-    if not 'TIMEZONE' in context:
+    # If SITEURL is defined but FEED_DOMAIN isn't, set FEED_DOMAIN = SITEURL
+    if ('SITEURL' in settings) and (not 'FEED_DOMAIN' in settings):
+        settings['FEED_DOMAIN'] = settings['SITEURL']
+
+    # Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined
+    if (('FEED' in settings) or ('FEED_RSS' in settings)) and (not 'FEED_DOMAIN' in settings):
+        logger.warn("Since feed URLs should always be absolute, you should specify "
+                 "FEED_DOMAIN in your settings. (e.g., 'FEED_DOMAIN = "
+                 "http://www.example.com')")
+
+    if not 'TIMEZONE' in settings:
         logger.warn("No timezone information specified in the settings. Assuming"
                  " your timezone is UTC for feed generation. Check "
                  "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone "
                  "for more information")
 
-    # set the locale
-    return context
+    return settings
diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py
--- a/samples/pelican.conf.py
+++ b/samples/pelican.conf.py
@@ -29,7 +29,7 @@
 DEFAULT_METADATA = (('yeah', 'it is'),)
 
 # static paths will be copied under the same name
-STATIC_PATHS = ["pictures",]
+STATIC_PATHS = ["pictures", ]
 
 # A list of files to copy from the source to the destination
 FILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),)
@@ -37,4 +37,3 @@
 # foobar will not be used, because it's not in caps. All configuration keys
 # have to be in caps
 foobar = "barbaz"
-

{"golden_diff": "diff --git a/pelican/settings.py b/pelican/settings.py\n--- a/pelican/settings.py\n+++ b/pelican/settings.py\n@@ -22,6 +22,7 @@\n                    'STATIC_PATHS': ['images', ],\n                    'THEME_STATIC_PATHS': ['static', ],\n                    'FEED': 'feeds/all.atom.xml',\n+                   'FEED_MAIN_URL': 'feeds/all.atom.xml',\n                    'CATEGORY_FEED': 'feeds/%s.atom.xml',\n                    'TRANSLATION_FEED': 'feeds/all-%s.atom.xml',\n                    'FEED_MAX_ITEMS': '',\n@@ -71,26 +72,45 @@\n \n \n def read_settings(filename=None):\n+    if filename:\n+        local_settings = get_settings_from_file(filename)\n+    else:\n+        local_settings = _DEFAULT_CONFIG\n+    configured_settings = configure_settings(local_settings, None, filename)\n+    return configured_settings\n+\n+\n+def get_settings_from_file(filename, default_settings=None):\n     \"\"\"Load a Python file into a dictionary.\n     \"\"\"\n-    context = _DEFAULT_CONFIG.copy()\n+    if default_settings == None:\n+        default_settings = _DEFAULT_CONFIG\n+    context = default_settings.copy()\n     if filename:\n         tempdict = {}\n         execfile(filename, tempdict)\n         for key in tempdict:\n             if key.isupper():\n                 context[key] = tempdict[key]\n+    return context\n+\n \n-        # Make the paths relative to the settings file\n+def configure_settings(settings, default_settings=None, filename=None):\n+    \"\"\"Provide optimizations, error checking, and warnings for loaded settings\"\"\"\n+    if default_settings is None:\n+        default_settings = _DEFAULT_CONFIG\n+\n+    # Make the paths relative to the settings file\n+    if filename:\n         for path in ['PATH', 'OUTPUT_PATH']:\n-            if path in context:\n-                if context[path] is not None and not isabs(context[path]):\n-                    context[path] = os.path.abspath(os.path.normpath(\n-                        os.path.join(os.path.dirname(filename), context[path]))\n+            if path in settings:\n+                if settings[path] is not None and not isabs(settings[path]):\n+                    settings[path] = os.path.abspath(os.path.normpath(\n+                        os.path.join(os.path.dirname(filename), settings[path]))\n                     )\n \n     # if locales is not a list, make it one\n-    locales = context['LOCALE']\n+    locales = settings['LOCALE']\n \n     if isinstance(locales, basestring):\n         locales = [locales]\n@@ -108,11 +128,20 @@\n     else:\n         logger.warn(\"LOCALE option doesn't contain a correct value\")\n \n-    if not 'TIMEZONE' in context:\n+    # If SITEURL is defined but FEED_DOMAIN isn't, set FEED_DOMAIN = SITEURL\n+    if ('SITEURL' in settings) and (not 'FEED_DOMAIN' in settings):\n+        settings['FEED_DOMAIN'] = settings['SITEURL']\n+\n+    # Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined\n+    if (('FEED' in settings) or ('FEED_RSS' in settings)) and (not 'FEED_DOMAIN' in settings):\n+        logger.warn(\"Since feed URLs should always be absolute, you should specify \"\n+                 \"FEED_DOMAIN in your settings. (e.g., 'FEED_DOMAIN = \"\n+                 \"http://www.example.com')\")\n+\n+    if not 'TIMEZONE' in settings:\n         logger.warn(\"No timezone information specified in the settings. Assuming\"\n                  \" your timezone is UTC for feed generation. Check \"\n                  \"http://docs.notmyidea.org/alexis/pelican/settings.html#timezone \"\n                  \"for more information\")\n \n-    # set the locale\n-    return context\n+    return settings\ndiff --git a/samples/pelican.conf.py b/samples/pelican.conf.py\n--- a/samples/pelican.conf.py\n+++ b/samples/pelican.conf.py\n@@ -29,7 +29,7 @@\n DEFAULT_METADATA = (('yeah', 'it is'),)\n \n # static paths will be copied under the same name\n-STATIC_PATHS = [\"pictures\",]\n+STATIC_PATHS = [\"pictures\", ]\n \n # A list of files to copy from the source to the destination\n FILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),)\n@@ -37,4 +37,3 @@\n # foobar will not be used, because it's not in caps. All configuration keys\n # have to be in caps\n foobar = \"barbaz\"\n-\n", "issue": "Add support for Google feedburner\nHi all,\n\nDo you have any plan to add support for [Google feedburner](http://feedburner.google.com/)? It is very useful to track feed subscribers, provide a HTMLized feed page and so on. To use this, Pelican need to show a feedburner's address to visitors while providing a feed to the feedburner as before.\n\nRegards.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nAUTHOR = u'Alexis M\u00e9taireau'\nSITENAME = u\"Alexis' log\"\nSITEURL = 'http://blog.notmyidea.org'\nTIMEZONE = \"Europe/Paris\"\n\nGITHUB_URL = 'http://github.com/ametaireau/'\nDISQUS_SITENAME = \"blog-notmyidea\"\nPDF_GENERATOR = False\nREVERSE_CATEGORY_ORDER = True\nLOCALE = \"\"\nDEFAULT_PAGINATION = 4\n\nFEED_RSS = 'feeds/all.rss.xml'\nCATEGORY_FEED_RSS = 'feeds/%s.rss.xml'\n\nLINKS = (('Biologeek', 'http://biologeek.org'),\n         ('Filyb', \"http://filyb.info/\"),\n         ('Libert-fr', \"http://www.libert-fr.com\"),\n         ('N1k0', \"http://prendreuncafe.com/blog/\"),\n         (u'Tarek Ziad\u00e9', \"http://ziade.org/blog\"),\n         ('Zubin Mithra', \"http://zubin71.wordpress.com/\"),)\n\nSOCIAL = (('twitter', 'http://twitter.com/ametaireau'),\n          ('lastfm', 'http://lastfm.com/user/akounet'),\n          ('github', 'http://github.com/ametaireau'),)\n\n# global metadata to all the contents\nDEFAULT_METADATA = (('yeah', 'it is'),)\n\n# static paths will be copied under the same name\nSTATIC_PATHS = [\"pictures\",]\n\n# A list of files to copy from the source to the destination\nFILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),)\n\n# foobar will not be used, because it's not in caps. All configuration keys\n# have to be in caps\nfoobar = \"barbaz\"\n\n", "path": "samples/pelican.conf.py"}, {"content": "# -*- coding: utf-8 -*-\nimport os\nimport locale\nimport logging\n\nfrom os.path import isabs\n\n\nlogger = logging.getLogger(__name__)\n\n\nDEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),\n                              \"themes/notmyidea\"])\n_DEFAULT_CONFIG = {'PATH': None,\n                   'ARTICLE_DIR': '',\n                   'ARTICLE_EXCLUDES': ('pages',),\n                   'PAGE_DIR': 'pages',\n                   'PAGE_EXCLUDES': (),\n                   'THEME': DEFAULT_THEME,\n                   'OUTPUT_PATH': 'output/',\n                   'MARKUP': ('rst', 'md'),\n                   'STATIC_PATHS': ['images', ],\n                   'THEME_STATIC_PATHS': ['static', ],\n                   'FEED': 'feeds/all.atom.xml',\n                   'CATEGORY_FEED': 'feeds/%s.atom.xml',\n                   'TRANSLATION_FEED': 'feeds/all-%s.atom.xml',\n                   'FEED_MAX_ITEMS': '',\n                   'SITENAME': 'A Pelican Blog',\n                   'DISPLAY_PAGES_ON_MENU': True,\n                   'PDF_GENERATOR': False,\n                   'DEFAULT_CATEGORY': 'misc',\n                   'FALLBACK_ON_FS_DATE': True,\n                   'WITH_FUTURE_DATES': True,\n                   'CSS_FILE': 'main.css',\n                   'REVERSE_ARCHIVE_ORDER': False,\n                   'REVERSE_CATEGORY_ORDER': False,\n                   'DELETE_OUTPUT_DIRECTORY': False,\n                   'ARTICLE_URL': '{slug}.html',\n                   'ARTICLE_SAVE_AS': '{slug}.html',\n                   'ARTICLE_LANG_URL': '{slug}-{lang}.html',\n                   'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html',\n                   'PAGE_URL': 'pages/{slug}.html',\n                   'PAGE_SAVE_AS': 'pages/{slug}.html',\n                   'PAGE_LANG_URL': 'pages/{slug}-{lang}.html',\n                   'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html',\n                   'CATEGORY_URL': 'category/{name}.html',\n                   'CATEGORY_SAVE_AS': 'category/{name}.html',\n                   'TAG_URL': 'tag/{slug}.html',\n                   'TAG_SAVE_AS': 'tag/{slug}.html',\n                   'AUTHOR_URL': u'author/{slug}.html',\n                   'AUTHOR_SAVE_AS': u'author/{slug}.html',\n                   'RELATIVE_URLS': True,\n                   'DEFAULT_LANG': 'en',\n                   'TAG_CLOUD_STEPS': 4,\n                   'TAG_CLOUD_MAX_ITEMS': 100,\n                   'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'archives'),\n                   'PAGINATED_DIRECT_TEMPLATES': ('index', ),\n                   'PELICAN_CLASS': 'pelican.Pelican',\n                   'DEFAULT_DATE_FORMAT': '%a %d %B %Y',\n                   'DATE_FORMATS': {},\n                   'JINJA_EXTENSIONS': [],\n                   'LOCALE': '',  # default to user locale\n                   'DEFAULT_PAGINATION': False,\n                   'DEFAULT_ORPHANS': 0,\n                   'DEFAULT_METADATA': (),\n                   'FILES_TO_COPY': (),\n                   'DEFAULT_STATUS': 'published',\n                   'ARTICLE_PERMALINK_STRUCTURE': '',\n                   'TYPOGRIFY': False,\n                   }\n\n\ndef read_settings(filename=None):\n    \"\"\"Load a Python file into a dictionary.\n    \"\"\"\n    context = _DEFAULT_CONFIG.copy()\n    if filename:\n        tempdict = {}\n        execfile(filename, tempdict)\n        for key in tempdict:\n            if key.isupper():\n                context[key] = tempdict[key]\n\n        # Make the paths relative to the settings file\n        for path in ['PATH', 'OUTPUT_PATH']:\n            if path in context:\n                if context[path] is not None and not isabs(context[path]):\n                    context[path] = os.path.abspath(os.path.normpath(\n                        os.path.join(os.path.dirname(filename), context[path]))\n                    )\n\n    # if locales is not a list, make it one\n    locales = context['LOCALE']\n\n    if isinstance(locales, basestring):\n        locales = [locales]\n\n    # try to set the different locales, fallback on the default.\n    if not locales:\n        locales = _DEFAULT_CONFIG['LOCALE']\n\n    for locale_ in locales:\n        try:\n            locale.setlocale(locale.LC_ALL, locale_)\n            break  # break if it is successfull\n        except locale.Error:\n            pass\n    else:\n        logger.warn(\"LOCALE option doesn't contain a correct value\")\n\n    if not 'TIMEZONE' in context:\n        logger.warn(\"No timezone information specified in the settings. Assuming\"\n                 \" your timezone is UTC for feed generation. Check \"\n                 \"http://docs.notmyidea.org/alexis/pelican/settings.html#timezone \"\n                 \"for more information\")\n\n    # set the locale\n    return context\n", "path": "pelican/settings.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nAUTHOR = u'Alexis M\u00e9taireau'\nSITENAME = u\"Alexis' log\"\nSITEURL = 'http://blog.notmyidea.org'\nTIMEZONE = \"Europe/Paris\"\n\nGITHUB_URL = 'http://github.com/ametaireau/'\nDISQUS_SITENAME = \"blog-notmyidea\"\nPDF_GENERATOR = False\nREVERSE_CATEGORY_ORDER = True\nLOCALE = \"\"\nDEFAULT_PAGINATION = 4\n\nFEED_RSS = 'feeds/all.rss.xml'\nCATEGORY_FEED_RSS = 'feeds/%s.rss.xml'\n\nLINKS = (('Biologeek', 'http://biologeek.org'),\n         ('Filyb', \"http://filyb.info/\"),\n         ('Libert-fr', \"http://www.libert-fr.com\"),\n         ('N1k0', \"http://prendreuncafe.com/blog/\"),\n         (u'Tarek Ziad\u00e9', \"http://ziade.org/blog\"),\n         ('Zubin Mithra', \"http://zubin71.wordpress.com/\"),)\n\nSOCIAL = (('twitter', 'http://twitter.com/ametaireau'),\n          ('lastfm', 'http://lastfm.com/user/akounet'),\n          ('github', 'http://github.com/ametaireau'),)\n\n# global metadata to all the contents\nDEFAULT_METADATA = (('yeah', 'it is'),)\n\n# static paths will be copied under the same name\nSTATIC_PATHS = [\"pictures\", ]\n\n# A list of files to copy from the source to the destination\nFILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),)\n\n# foobar will not be used, because it's not in caps. All configuration keys\n# have to be in caps\nfoobar = \"barbaz\"\n", "path": "samples/pelican.conf.py"}, {"content": "# -*- coding: utf-8 -*-\nimport os\nimport locale\nimport logging\n\nfrom os.path import isabs\n\n\nlogger = logging.getLogger(__name__)\n\n\nDEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),\n                              \"themes/notmyidea\"])\n_DEFAULT_CONFIG = {'PATH': None,\n                   'ARTICLE_DIR': '',\n                   'ARTICLE_EXCLUDES': ('pages',),\n                   'PAGE_DIR': 'pages',\n                   'PAGE_EXCLUDES': (),\n                   'THEME': DEFAULT_THEME,\n                   'OUTPUT_PATH': 'output/',\n                   'MARKUP': ('rst', 'md'),\n                   'STATIC_PATHS': ['images', ],\n                   'THEME_STATIC_PATHS': ['static', ],\n                   'FEED': 'feeds/all.atom.xml',\n                   'FEED_MAIN_URL': 'feeds/all.atom.xml',\n                   'CATEGORY_FEED': 'feeds/%s.atom.xml',\n                   'TRANSLATION_FEED': 'feeds/all-%s.atom.xml',\n                   'FEED_MAX_ITEMS': '',\n                   'SITENAME': 'A Pelican Blog',\n                   'DISPLAY_PAGES_ON_MENU': True,\n                   'PDF_GENERATOR': False,\n                   'DEFAULT_CATEGORY': 'misc',\n                   'FALLBACK_ON_FS_DATE': True,\n                   'WITH_FUTURE_DATES': True,\n                   'CSS_FILE': 'main.css',\n                   'REVERSE_ARCHIVE_ORDER': False,\n                   'REVERSE_CATEGORY_ORDER': False,\n                   'DELETE_OUTPUT_DIRECTORY': False,\n                   'ARTICLE_URL': '{slug}.html',\n                   'ARTICLE_SAVE_AS': '{slug}.html',\n                   'ARTICLE_LANG_URL': '{slug}-{lang}.html',\n                   'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html',\n                   'PAGE_URL': 'pages/{slug}.html',\n                   'PAGE_SAVE_AS': 'pages/{slug}.html',\n                   'PAGE_LANG_URL': 'pages/{slug}-{lang}.html',\n                   'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html',\n                   'CATEGORY_URL': 'category/{name}.html',\n                   'CATEGORY_SAVE_AS': 'category/{name}.html',\n                   'TAG_URL': 'tag/{slug}.html',\n                   'TAG_SAVE_AS': 'tag/{slug}.html',\n                   'AUTHOR_URL': u'author/{slug}.html',\n                   'AUTHOR_SAVE_AS': u'author/{slug}.html',\n                   'RELATIVE_URLS': True,\n                   'DEFAULT_LANG': 'en',\n                   'TAG_CLOUD_STEPS': 4,\n                   'TAG_CLOUD_MAX_ITEMS': 100,\n                   'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'archives'),\n                   'PAGINATED_DIRECT_TEMPLATES': ('index', ),\n                   'PELICAN_CLASS': 'pelican.Pelican',\n                   'DEFAULT_DATE_FORMAT': '%a %d %B %Y',\n                   'DATE_FORMATS': {},\n                   'JINJA_EXTENSIONS': [],\n                   'LOCALE': '',  # default to user locale\n                   'DEFAULT_PAGINATION': False,\n                   'DEFAULT_ORPHANS': 0,\n                   'DEFAULT_METADATA': (),\n                   'FILES_TO_COPY': (),\n                   'DEFAULT_STATUS': 'published',\n                   'ARTICLE_PERMALINK_STRUCTURE': '',\n                   'TYPOGRIFY': False,\n                   }\n\n\ndef read_settings(filename=None):\n    if filename:\n        local_settings = get_settings_from_file(filename)\n    else:\n        local_settings = _DEFAULT_CONFIG\n    configured_settings = configure_settings(local_settings, None, filename)\n    return configured_settings\n\n\ndef get_settings_from_file(filename, default_settings=None):\n    \"\"\"Load a Python file into a dictionary.\n    \"\"\"\n    if default_settings == None:\n        default_settings = _DEFAULT_CONFIG\n    context = default_settings.copy()\n    if filename:\n        tempdict = {}\n        execfile(filename, tempdict)\n        for key in tempdict:\n            if key.isupper():\n                context[key] = tempdict[key]\n    return context\n\n\ndef configure_settings(settings, default_settings=None, filename=None):\n    \"\"\"Provide optimizations, error checking, and warnings for loaded settings\"\"\"\n    if default_settings is None:\n        default_settings = _DEFAULT_CONFIG\n\n    # Make the paths relative to the settings file\n    if filename:\n        for path in ['PATH', 'OUTPUT_PATH']:\n            if path in settings:\n                if settings[path] is not None and not isabs(settings[path]):\n                    settings[path] = os.path.abspath(os.path.normpath(\n                        os.path.join(os.path.dirname(filename), settings[path]))\n                    )\n\n    # if locales is not a list, make it one\n    locales = settings['LOCALE']\n\n    if isinstance(locales, basestring):\n        locales = [locales]\n\n    # try to set the different locales, fallback on the default.\n    if not locales:\n        locales = _DEFAULT_CONFIG['LOCALE']\n\n    for locale_ in locales:\n        try:\n            locale.setlocale(locale.LC_ALL, locale_)\n            break  # break if it is successfull\n        except locale.Error:\n            pass\n    else:\n        logger.warn(\"LOCALE option doesn't contain a correct value\")\n\n    # If SITEURL is defined but FEED_DOMAIN isn't, set FEED_DOMAIN = SITEURL\n    if ('SITEURL' in settings) and (not 'FEED_DOMAIN' in settings):\n        settings['FEED_DOMAIN'] = settings['SITEURL']\n\n    # Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined\n    if (('FEED' in settings) or ('FEED_RSS' in settings)) and (not 'FEED_DOMAIN' in settings):\n        logger.warn(\"Since feed URLs should always be absolute, you should specify \"\n                 \"FEED_DOMAIN in your settings. (e.g., 'FEED_DOMAIN = \"\n                 \"http://www.example.com')\")\n\n    if not 'TIMEZONE' in settings:\n        logger.warn(\"No timezone information specified in the settings. Assuming\"\n                 \" your timezone is UTC for feed generation. Check \"\n                 \"http://docs.notmyidea.org/alexis/pelican/settings.html#timezone \"\n                 \"for more information\")\n\n    return settings\n", "path": "pelican/settings.py"}]}