From cc46ac5d4cade47e84fa304639375f57c4938cda Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sat, 28 Apr 2012 18:01:19 +0100 Subject: [PATCH 1/6] Allow user to customise the save location of direct template pages from settings. --- pelican/generators.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 9f4de79b..43861b23 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -182,7 +182,15 @@ class ArticlesGenerator(Generator): if template in PAGINATED_TEMPLATES: paginated = {'articles': self.articles, 'dates': self.dates} - write('%s.html' % template, self.get_template(template), + save_as = self.settings.get("%s_SAVE_AS" % template.upper(), None) + if save_as is None: + file_name = '%s.html' % template + elif save_as: + file_name = save_as + else: + continue + + write(file_name, self.get_template(template), self.context, blog=True, paginated=paginated, page_name=template) From c7de5e6bff23f98e96b3844cded3391acedc3002 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sat, 28 Apr 2012 18:02:10 +0100 Subject: [PATCH 2/6] add docs for customised save location for direct template pages and switch to notes directive for notes --- docs/settings.rst | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 9cae8111..7c19b539 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -39,9 +39,9 @@ Setting name (default value) What does it do? `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. `DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as the generated files. -`LOCALE` (''[#]_) Change the locale. A list of locales can be provided +`LOCALE` (''[#]_) Change the locale. A list of locales can be provided here or a single string representing one locale. - When providing a list, all the locales will be tried + When providing a list, all the locales will be tried until one works. `MARKUP` (``('rst', 'md')``) A list of available markup languages you want to use. For the moment, the only available values @@ -96,14 +96,15 @@ your articles in a location such as '{slug}/index.html' and link to them as '{slug}' for clean URLs. These settings give you the flexibility to place your articles and pages anywhere you want. -Note: If you specify a datetime directive, it will be substituted using the -input files' date metadata attribute. If the date is not specified for a -particular file, Pelican will rely on the file's mtime timestamp. +.. note:: + If you specify a datetime directive, it will be substituted using the + input files' date metadata attribute. If the date is not specified for a + particular file, Pelican will rely on the file's mtime timestamp. Check the Python datetime documentation at http://bit.ly/cNcJUC for more information. -Also, you can use other file metadata attributes as well: +Also, you can use other file metadata attributes as well: * slug * date @@ -111,7 +112,7 @@ Also, you can use other file metadata attributes as well: * author * category -Example usage: +Example usage: * ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/' * ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html' @@ -142,7 +143,14 @@ Setting name (default value) what does it do? `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. ================================================ ===================================================== -Note: when any of `*_SAVE_AS` is set to False, files will not be created. +.. note:: + + When any of `*_SAVE_AS` is set to False, files will not be created. + + You can change the file output location of any pages listed in DIRECT_TEMPLATES + by providing a setting _SAVE_AS, where is the template + name in uppercase; e.g. CATEGORIES. If False it will not be created. + Timezone -------- @@ -332,7 +340,7 @@ Setting name (default value) What does it do? ================================================ ===================================================== `REVERSE_ARCHIVE_ORDER` (``False``) Reverse the archives list order. (True: orders by date in descending order, with newer articles first.) -`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse +`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse alphabetical order; default lists alphabetically.) ================================================ ===================================================== From e4f011a697f3b3ca430c57108c9633f9acad5d02 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sun, 29 Apr 2012 10:34:20 +0100 Subject: [PATCH 3/6] Refactor generators to aid testing --- pelican/generators.py | 48 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 43861b23..99f4bef8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -162,20 +162,22 @@ class ArticlesGenerator(Generator): writer.write_feed(items, self.context, self.settings['TRANSLATION_FEED'] % lang) - def generate_pages(self, writer): - """Generate the pages on the disk""" - + def generate_articles(self, writer): + """Generate the articles.""" write = partial(writer.write_file, relative_urls=self.settings.get('RELATIVE_URLS')) - # to minimize the number of relative path stuff modification - # in writer, articles pass first article_template = self.get_template('article') for article in chain(self.translations, self.articles): write(article.save_as, article_template, self.context, article=article, category=article.category) + def generate_direct_templates(self, writer): + """Generate direct templates pages""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + PAGINATED_TEMPLATES = self.settings.get('PAGINATED_DIRECT_TEMPLATES') for template in self.settings.get('DIRECT_TEMPLATES'): paginated = {} @@ -194,7 +196,11 @@ class ArticlesGenerator(Generator): self.context, blog=True, paginated=paginated, page_name=template) - # and subfolders after that + def generate_tags(self, writer): + """Generate Tags pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + tag_template = self.get_template('tag') for tag, articles in self.tags.items(): articles.sort(key=attrgetter('date'), reverse=True) @@ -204,6 +210,11 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'tag/%s' % tag) + def generate_categories(self, writer): + """Generate category pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + category_template = self.get_template('category') for cat, articles in self.categories: dates = [article for article in self.dates if article in articles] @@ -212,6 +223,11 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'category/%s' % cat) + def generate_authors(self, writer): + """Generate Author pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + author_template = self.get_template('author') for aut, articles in self.authors: dates = [article for article in self.dates if article in articles] @@ -220,10 +236,30 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'author/%s' % aut) + def generate_drafts(self, writer): + """Generate drafts pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + + article_template = self.get_template('article') for article in self.drafts: write('drafts/%s.html' % article.slug, article_template, self.context, article=article, category=article.category) + def generate_pages(self, writer): + """Generate the pages on the disk""" + + # to minimize the number of relative path stuff modification + # in writer, articles pass first + self.generate_articles(writer) + self.generate_direct_templates(writer) + + # and subfolders after that + self.generate_tags(writer) + self.generate_categories(writer) + self.generate_authors(writer) + self.generate_drafts(writer) + def generate_context(self): """change the context""" From 5ab1933be7c9a337d20cdeb3857b3da0feeaef06 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sun, 29 Apr 2012 13:45:14 +0100 Subject: [PATCH 4/6] added tests for custom save_as for direct templates --- tests/test_generators.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/test_generators.py b/tests/test_generators.py index bc5c8b73..fc35fde4 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -9,6 +9,7 @@ from .support import unittest CUR_DIR = os.path.dirname(__file__) + class TestArticlesGenerator(unittest.TestCase): def test_generate_feeds(self): @@ -46,3 +47,42 @@ class TestArticlesGenerator(unittest.TestCase): elif relfilepath == "article_without_category.rst": self.assertEquals(article.category.name, 'Default') + def test_direct_templates_save_as_default(self): + + settings = _DEFAULT_CONFIG.copy() + settings['DIRECT_TEMPLATES'] = ['archives'] + generator = ArticlesGenerator(settings.copy(), settings, None, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + + writer = MagicMock() + generator.generate_direct_templates(writer) + writer.write_file.assert_called_with("archives.html", + generator.get_template("archives"), settings, relative_urls=True, + blog=True, paginated={}, page_name='archives') + + def test_direct_templates_save_as_modified(self): + + settings = _DEFAULT_CONFIG.copy() + settings['DIRECT_TEMPLATES'] = ['archives'] + settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' + generator = ArticlesGenerator(settings, settings, None, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + writer = MagicMock() + generator.generate_direct_templates(writer) + writer.write_file.assert_called_with("archives/index.html", + generator.get_template("archives"), settings, relative_urls=True, + blog=True, paginated={}, page_name='archives') + + def test_direct_templates_save_as_false(self): + + settings = _DEFAULT_CONFIG.copy() + settings['DIRECT_TEMPLATES'] = ['archives'] + settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' + generator = ArticlesGenerator(settings, settings, None, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + writer = MagicMock() + generator.generate_direct_templates(writer) + writer.write_file.assert_called_count == 0 From 06ba9acdb850f8c6f2ba21bb35757a8e5277209d Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Wed, 2 May 2012 09:26:33 +0100 Subject: [PATCH 5/6] Pass write function to reduce duplication. Simplify logic. --- pelican/generators.py | 59 ++++++++++++++-------------------------- tests/test_generators.py | 23 ++++++++-------- 2 files changed, 31 insertions(+), 51 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 99f4bef8..86e5db9b 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -162,45 +162,32 @@ class ArticlesGenerator(Generator): writer.write_feed(items, self.context, self.settings['TRANSLATION_FEED'] % lang) - def generate_articles(self, writer): + def generate_articles(self, write): """Generate the articles.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - article_template = self.get_template('article') for article in chain(self.translations, self.articles): write(article.save_as, article_template, self.context, article=article, category=article.category) - def generate_direct_templates(self, writer): + def generate_direct_templates(self, write): """Generate direct templates pages""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - PAGINATED_TEMPLATES = self.settings.get('PAGINATED_DIRECT_TEMPLATES') for template in self.settings.get('DIRECT_TEMPLATES'): paginated = {} if template in PAGINATED_TEMPLATES: paginated = {'articles': self.articles, 'dates': self.dates} + save_as = self.settings.get("%s_SAVE_AS" % template.upper(), + '%s.html' % template) + if not save_as: + continue - save_as = self.settings.get("%s_SAVE_AS" % template.upper(), None) - if save_as is None: - file_name = '%s.html' % template - elif save_as: - file_name = save_as - else: - continue - - write(file_name, self.get_template(template), + write(save_as, self.get_template(template), self.context, blog=True, paginated=paginated, page_name=template) - def generate_tags(self, writer): + def generate_tags(self, write): """Generate Tags pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - tag_template = self.get_template('tag') for tag, articles in self.tags.items(): articles.sort(key=attrgetter('date'), reverse=True) @@ -210,11 +197,8 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'tag/%s' % tag) - def generate_categories(self, writer): + def generate_categories(self, write): """Generate category pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - category_template = self.get_template('category') for cat, articles in self.categories: dates = [article for article in self.dates if article in articles] @@ -223,11 +207,8 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'category/%s' % cat) - def generate_authors(self, writer): + def generate_authors(self, write): """Generate Author pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - author_template = self.get_template('author') for aut, articles in self.authors: dates = [article for article in self.dates if article in articles] @@ -236,11 +217,8 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'author/%s' % aut) - def generate_drafts(self, writer): + def generate_drafts(self, write): """Generate drafts pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - article_template = self.get_template('article') for article in self.drafts: write('drafts/%s.html' % article.slug, article_template, @@ -248,17 +226,20 @@ class ArticlesGenerator(Generator): def generate_pages(self, writer): """Generate the pages on the disk""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) # to minimize the number of relative path stuff modification # in writer, articles pass first - self.generate_articles(writer) - self.generate_direct_templates(writer) + self.generate_articles(write) + self.generate_direct_templates(write) + # and subfolders after that - self.generate_tags(writer) - self.generate_categories(writer) - self.generate_authors(writer) - self.generate_drafts(writer) + self.generate_tags(write) + self.generate_categories(write) + self.generate_authors(write) + self.generate_drafts(write) def generate_context(self): """change the context""" diff --git a/tests/test_generators.py b/tests/test_generators.py index fc35fde4..dd2ca9cb 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -54,11 +54,10 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator(settings.copy(), settings, None, _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) - - writer = MagicMock() - generator.generate_direct_templates(writer) - writer.write_file.assert_called_with("archives.html", - generator.get_template("archives"), settings, relative_urls=True, + write = MagicMock() + generator.generate_direct_templates(write) + write.assert_called_with("archives.html", + generator.get_template("archives"), settings, blog=True, paginated={}, page_name='archives') def test_direct_templates_save_as_modified(self): @@ -69,10 +68,10 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator(settings, settings, None, _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) - writer = MagicMock() - generator.generate_direct_templates(writer) - writer.write_file.assert_called_with("archives/index.html", - generator.get_template("archives"), settings, relative_urls=True, + write = MagicMock() + generator.generate_direct_templates(write) + write.assert_called_with("archives/index.html", + generator.get_template("archives"), settings, blog=True, paginated={}, page_name='archives') def test_direct_templates_save_as_false(self): @@ -83,6 +82,6 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator(settings, settings, None, _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) - writer = MagicMock() - generator.generate_direct_templates(writer) - writer.write_file.assert_called_count == 0 + write = MagicMock() + generator.generate_direct_templates(write) + write.assert_called_count == 0 From df7b2c968e1b026f24546adbcc5511e597d64615 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Wed, 9 May 2012 23:24:31 +0100 Subject: [PATCH 6/6] Add documentation for DIRECT_TEMPLATES and PAGINATED_DIRECT_TEMPLATES --- docs/settings.rst | 139 +++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 68 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 7c19b539..b5f3c4ad 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -21,68 +21,73 @@ Here is a list of settings for Pelican: Basic settings ============== -================================================ ===================================================== -Setting name (default value) What does it do? -================================================ ===================================================== -`AUTHOR` Default author (put your name) -`DATE_FORMATS` (``{}``) If you do manage multiple languages, you can - set the date formatting here. See "Date format and locales" - section below for details. -`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. -`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. -`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the - template. Templates may or not honor this - setting. -`FALLBACK_ON_FS_DATE` (``True``) If True, Pelican will use the file system - timestamp information (mtime) if it can't get - date information from the metadata. -`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. -`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as - the generated files. -`LOCALE` (''[#]_) Change the locale. A list of locales can be provided - here or a single string representing one locale. - When providing a list, all the locales will be tried - until one works. -`MARKUP` (``('rst', 'md')``) A list of available markup languages you want - to use. For the moment, the only available values - are `rst` and `md`. -`MD_EXTENSIONS` (``['codehilite','extra']``) A list of the extensions that the Markdown processor - will use. Refer to the extensions chapter in the - Python-Markdown documentation for a complete list of - supported extensions. -`OUTPUT_PATH` (``'output/'``) Where to output the generated files. -`PATH` (``None``) Path to look at for input files. -`PAGE_DIR` (``'pages'``) Directory to look at for pages. -`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. -`ARTICLE_DIR` (``''``) Directory to look at for articles. -`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. -`PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions - of your documents. You will need to install - `rst2pdf`. -`RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or - not. -`SITENAME` (``'A Pelican Blog'``) Your site name -`SITEURL` Base URL of your website. Not defined by default, - which means the base URL is assumed to be "/" with a - root-relative URL structure. If `SITEURL` is specified - explicitly, there should be no trailing slash at the end, - and URLs will be generated with an absolute URL structure - (including the domain). If you want to use relative URLs - instead of root-relative or absolute URLs, you should - instead use the `RELATIVE_URL` setting. -`STATIC_PATHS` (``['images']``) The static paths you want to have accessible - on the output path "static". By default, - Pelican will copy the 'images' folder to the - output folder. -`TIMEZONE` The timezone used in the date information, to - generate Atom and RSS feeds. See the "timezone" - section below for more info. -`TYPOGRIFY` (``False``) If set to true, some - additional transformations will be done on the - generated HTML, using the `Typogrify - `_ - library -================================================ ===================================================== +===================================================================== ===================================================================== +Setting name (default value) What does it do? +===================================================================== ===================================================================== +`AUTHOR` Default author (put your name) +`DATE_FORMATS` (``{}``) If you do manage multiple languages, you can + set the date formatting here. See "Date format and locales" + section below for details. +`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. +`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. +`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the + template. Templates may or not honor this + setting. +`FALLBACK_ON_FS_DATE` (``True``) If True, Pelican will use the file system + timestamp information (mtime) if it can't get + date information from the metadata. +`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. +`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as + the generated files. +`LOCALE` (''[#]_) Change the locale. A list of locales can be provided + here or a single string representing one locale. + When providing a list, all the locales will be tried + until one works. +`MARKUP` (``('rst', 'md')``) A list of available markup languages you want + to use. For the moment, the only available values + are `rst` and `md`. +`MD_EXTENSIONS` (``['codehilite','extra']``) A list of the extensions that the Markdown processor + will use. Refer to the extensions chapter in the + Python-Markdown documentation for a complete list of + supported extensions. +`OUTPUT_PATH` (``'output/'``) Where to output the generated files. +`PATH` (``None``) Path to look at for input files. +`PAGE_DIR` (``'pages'``) Directory to look at for pages. +`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. +`ARTICLE_DIR` (``''``) Directory to look at for articles. +`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. +`PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions + of your documents. You will need to install + `rst2pdf`. +`RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or + not. +`SITENAME` (``'A Pelican Blog'``) Your site name +`SITEURL` Base URL of your website. Not defined by default, + which means the base URL is assumed to be "/" with a + root-relative URL structure. If `SITEURL` is specified + explicitly, there should be no trailing slash at the end, + and URLs will be generated with an absolute URL structure + (including the domain). If you want to use relative URLs + instead of root-relative or absolute URLs, you should + instead use the `RELATIVE_URL` setting. +`STATIC_PATHS` (``['images']``) The static paths you want to have accessible + on the output path "static". By default, + Pelican will copy the 'images' folder to the + output folder. +`TIMEZONE` The timezone used in the date information, to + generate Atom and RSS feeds. See the "timezone" + section below for more info. +`TYPOGRIFY` (``False``) If set to true, some + additional transformations will be done on the + generated HTML, using the `Typogrify + `_ + library +`DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'archives')``) List of templates that are used directly to render + content. Typically direct templates are used to generate + index pages for collections of content e.g. tags and + category index pages. +`PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated. +===================================================================== ===================================================================== .. [#] Default is the system locale. @@ -96,7 +101,7 @@ your articles in a location such as '{slug}/index.html' and link to them as '{slug}' for clean URLs. These settings give you the flexibility to place your articles and pages anywhere you want. -.. note:: +.. note:: If you specify a datetime directive, it will be substituted using the input files' date metadata attribute. If the date is not specified for a particular file, Pelican will rely on the file's mtime timestamp. @@ -141,17 +146,15 @@ Setting name (default value) what does it do? `CATEGORY_SAVE_AS` ('category/{name}.html') The location to save a category. `TAG_URL` ('tag/{name}.html') The URL to use for a tag. `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. +`_SAVE_AS` The location to save content generated from direct + templates. Where is the + upper case template name. ================================================ ===================================================== .. note:: When any of `*_SAVE_AS` is set to False, files will not be created. - You can change the file output location of any pages listed in DIRECT_TEMPLATES - by providing a setting _SAVE_AS, where is the template - name in uppercase; e.g. CATEGORIES. If False it will not be created. - - Timezone --------