jenkins-bot submitted this change.
[8.0] Publish Pywikibot 8
- Update version
- update ROADMAP.rst
- update languages_by_size
- update WbTime.fromTimestamp documentation
Bug: T308258
Change-Id: Ie809c74ba8954a432b60ff1b561d9e220a0e6ee6
---
M pywikibot/__init__.py
M ROADMAP.rst
M pywikibot/__metadata__.py
M pywikibot/families/wikiquote_family.py
M pywikibot/families/wiktionary_family.py
M pywikibot/families/wikipedia_family.py
6 files changed, 57 insertions(+), 37 deletions(-)
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 77eb8a1..a1ed684 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -4,6 +4,7 @@
Improvements
^^^^^^^^^^^^
+* Allow copying timezone from timestamp in :class:`pywikibot.WbTime` (:phab:`T325864`)
* Support federated Wikibase (:phab:`T173195`)
* Improve warning if a Non-JSON response was received from server (:phab:`T326046`)
* Allow normalization of :class:`pywikibot.WbTime` objects (:phab:`T123888`)
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 25c39d2..c9a2149 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -570,38 +570,42 @@
precision, before, after, timezone, calendarmodel, site)
@classmethod
- def fromTimestamp(cls: Type['WbTime'], timestamp: 'Timestamp',
+ def fromTimestamp(cls: Type['WbTime'],
+ timestamp: 'Timestamp',
precision: Union[int, str] = 14,
- before: int = 0, after: int = 0,
- timezone: int = 0, calendarmodel: Optional[str] = None,
+ before: int = 0,
+ after: int = 0,
+ timezone: int = 0,
+ calendarmodel: Optional[str] = None,
site: Optional[DataSite] = None,
copy_timezone: bool = False) -> 'WbTime':
- """
- Create a new WbTime object from a pywikibot.Timestamp.
+ """Create a new WbTime object from a pywikibot.Timestamp.
+
+ .. versionchanged:: 8.0
+ Added *copy_timezone* parameter.
:param timestamp: Timestamp
- :param precision: The unit of the precision of the time. Defaults to
- 14 (second).
- :param before: Number of units after the given time it could be, if
- uncertain. The unit is given by the precision.
- :param after: Number of units before the given time it could be, if
- uncertain. The unit is given by the precision.
+ :param precision: The unit of the precision of the time.
+ Defaults to 14 (second).
+ :param before: Number of units after the given time it could be,
+ if uncertain. The unit is given by the precision.
+ :param after: Number of units before the given time it could be,
+ if uncertain. The unit is given by the precision.
:param timezone: Timezone information in minutes.
:param calendarmodel: URI identifying the calendar model.
- :param site: The Wikibase site. If not provided, retrieves the data
- repository from the default site from user-config.py.
+ :param site: The Wikibase site. If not provided, retrieves the
+ data repository from the default site from user-config.py.
Only used if calendarmodel is not given.
- :param copy_timezone: Whether to copy the timezone from the Timestamp
- if it has timezone information. Defaults to False to maintain
- backwards compatibility. If a timezone is given, timezone
- information is discarded.
+ :param copy_timezone: Whether to copy the timezone from the
+ timestamp if it has timezone information. Defaults to False
+ to maintain backwards compatibility. If a timezone is given,
+ timezone information is discarded.
"""
if not timezone and timestamp.tzinfo and copy_timezone:
timezone = int(timestamp.utcoffset().total_seconds() / 60)
return cls.fromTimestr(timestamp.isoformat(), precision=precision,
- before=before, after=after,
- timezone=timezone, calendarmodel=calendarmodel,
- site=site)
+ before=before, after=after, timezone=timezone,
+ calendarmodel=calendarmodel, site=site)
def normalize(self) -> 'WbTime':
"""Normalizes the WbTime object to account for precision.
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 152253c..a9e6e99 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -11,7 +11,7 @@
__name__ = 'pywikibot'
-__version__ = '8.0.0.dev0'
+__version__ = '8.0.0'
__description__ = 'Python MediaWiki Bot Framework'
__maintainer__ = 'The Pywikibot team'
__maintainer_email__ = 'pywikibot@lists.wikimedia.org'
diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py
index dbb42ae..0a0603e 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -30,32 +30,32 @@
'ja', 'zh', 'vi', 'war', 'uk', 'ar', 'pt', 'fa', 'ca', 'sr', 'id',
'ko', 'no', 'fi', 'tr', 'hu', 'cs', 'ce', 'tt', 'sh', 'ro',
'zh-min-nan', 'eu', 'ms', 'eo', 'he', 'hy', 'da', 'bg', 'cy', 'sk',
- 'azb', 'et', 'kk', 'be', 'min', 'simple', 'uz', 'el', 'hr', 'lt', 'gl',
+ 'azb', 'et', 'kk', 'be', 'simple', 'min', 'uz', 'el', 'hr', 'lt', 'gl',
'az', 'ur', 'sl', 'ka', 'nn', 'hi', 'th', 'ta', 'la', 'bn', 'mk',
'ast', 'zh-yue', 'lv', 'tg', 'af', 'my', 'mg', 'bs', 'mr', 'oc', 'sq',
'nds', 'ml', 'ky', 'be-tarask', 'te', 'br', 'sw', 'new', 'jv', 'lld',
'vec', 'ht', 'pnb', 'pms', 'ba', 'lb', 'su', 'ku', 'ga', 'lmo', 'szl',
'is', 'cv', 'fy', 'ckb', 'tl', 'an', 'wuu', 'diq', 'sco', 'pa', 'io',
- 'vo', 'yo', 'ne', 'gu', 'als', 'kn', 'ia', 'bar', 'scn', 'avk', 'bpy',
+ 'vo', 'yo', 'ne', 'gu', 'als', 'kn', 'ia', 'bar', 'avk', 'scn', 'bpy',
'qu', 'crh', 'mn', 'nv', 'ha', 'xmf', 'si', 'ban', 'bat-smg', 'ps',
'frr', 'os', 'or', 'sah', 'gd', 'bug', 'cdo', 'yi', 'ilo', 'sd', 'am',
- 'nap', 'li', 'fo', 'hsb', 'gor', 'map-bms', 'mai', 'mzn', 'ig', 'bcl',
+ 'nap', 'li', 'gor', 'fo', 'hsb', 'map-bms', 'mai', 'mzn', 'ig', 'bcl',
'eml', 'ace', 'shn', 'zh-classical', 'sa', 'wa', 'ie', 'lij', 'as',
'zu', 'mhr', 'mrj', 'hyw', 'hif', 'bjn', 'mni', 'sn', 'hak', 'km',
'roa-tara', 'so', 'pam', 'rue', 'nso', 'bh', 'tum', 'se', 'sat', 'mi',
- 'myv', 'vls', 'nds-nl', 'nah', 'sc', 'vep', 'kw', 'kab', 'tk', 'gan',
+ 'myv', 'vls', 'nds-nl', 'nah', 'sc', 'kw', 'vep', 'kab', 'tk', 'gan',
'co', 'glk', 'dag', 'fiu-vro', 'ary', 'bo', 'ab', 'gv', 'frp', 'zea',
'skr', 'ug', 'kv', 'pcd', 'udm', 'csb', 'mt', 'gn', 'ay', 'smn', 'nrm',
'lez', 'lfn', 'stq', 'olo', 'lo', 'rw', 'mwl', 'ang', 'fur', 'rm',
'lad', 'gom', 'koi', 'ext', 'tyv', 'dsb', 'av', 'dty', 'ln', 'cbk-zam',
'pap', 'kaa', 'dv', 'ksh', 'gag', 'bxr', 'pfl', 'ks', 'pag', 'pi',
- 'szy', 'haw', 'mdf', 'tw', 'awa', 'tay', 'za', 'blk', 'inh', 'krc',
+ 'tw', 'mdf', 'szy', 'haw', 'awa', 'tay', 'za', 'blk', 'inh', 'krc',
'xal', 'pdc', 'atj', 'to', 'arc', 'tcy', 'lg', 'mnw', 'kbp', 'jam',
'na', 'wo', 'kbd', 'nia', 'nov', 'ki', 'bi', 'nqo', 'tpi', 'tet',
'shi', 'jbo', 'roa-rup', 'fj', 'lbe', 'kg', 'xh', 'ty', 'cu', 'om',
- 'guw', 'trv', 'srn', 'sm', 'gcr', 'alt', 'chr', 'ltg', 'tn', 'ny',
- 'st', 'pih', 'mad', 'got', 'ami', 'rmy', 'bm', 've', 'ts', 'ff', 'chy',
- 'ss', 'rn', 'kcg', 'ak', 'iu', 'ch', 'ee', 'pnt', 'ik', 'ady', 'pcm',
+ 'guw', 'trv', 'srn', 'sm', 'gcr', 'alt', 'chr', 'tn', 'ltg', 'ny',
+ 'st', 'mad', 'pih', 'got', 'ami', 'rmy', 'bm', 've', 'ts', 'ff', 'chy',
+ 'ss', 'rn', 'kcg', 'ak', 'iu', 'ee', 'ch', 'pnt', 'ik', 'ady', 'pcm',
'sg', 'pwn', 'din', 'ti', 'kl', 'dz', 'cr',
]
diff --git a/pywikibot/families/wikiquote_family.py b/pywikibot/families/wikiquote_family.py
index 249561a..8f93dcc 100644
--- a/pywikibot/families/wikiquote_family.py
+++ b/pywikibot/families/wikiquote_family.py
@@ -30,7 +30,7 @@
'it', 'en', 'pl', 'ru', 'cs', 'et', 'pt', 'fa', 'uk', 'de', 'he', 'fr',
'es', 'eo', 'tr', 'sk', 'bs', 'az', 'ca', 'fi', 'sr', 'sl', 'zh', 'lt',
'ar', 'bg', 'hy', 'hr', 'su', 'el', 'nn', 'id', 'sv', 'li', 'hu', 'ko',
- 'nl', 'sah', 'ja', 'la', 'ta', 'gl', 'gu', 'ur', 'hi', 'ig', 'be',
+ 'nl', 'sah', 'ja', 'la', 'ta', 'gl', 'gu', 'hi', 'ur', 'ig', 'be',
'te', 'guw', 'tl', 'vi', 'cy', 'no', 'sq', 'ml', 'bn', 'kn', 'ro',
'eu', 'ku', 'as', 'uz', 'ka', 'da', 'sa', 'is', 'bcl', 'br', 'mr',
'af', 'th', 'wo', 'ky',
diff --git a/pywikibot/families/wiktionary_family.py b/pywikibot/families/wiktionary_family.py
index b8ab714..45ba4d9 100644
--- a/pywikibot/families/wiktionary_family.py
+++ b/pywikibot/families/wiktionary_family.py
@@ -37,16 +37,16 @@
'pt', 'kn', 'vi', 'sr', 'th', 'hi', 'ro', 'no', 'id', 'et', 'cs', 'ml',
'my', 'skr', 'uz', 'li', 'or', 'eo', 'te', 'fa', 'gl', 'ar', 'oc',
'jv', 'az', 'eu', 'uk', 'ast', 'br', 'is', 'sg', 'bn', 'da', 'lo',
- 'simple', 'mnw', 'la', 'hr', 'fj', 'shn', 'sk', 'tg', 'ky', 'bg', 'wa',
- 'ur', 'ps', 'cy', 'vo', 'he', 'om', 'lmo', 'sl', 'af', 'zh-min-nan',
+ 'simple', 'mnw', 'la', 'hr', 'shn', 'fj', 'sk', 'tg', 'ky', 'bg', 'wa',
+ 'ur', 'ps', 'cy', 'vo', 'he', 'lmo', 'om', 'sl', 'af', 'zh-min-nan',
'scn', 'tl', 'pa', 'ms', 'fy', 'sw', 'nn', 'ka', 'lv', 'min', 'sq',
'nds', 'lb', 'co', 'mn', 'pnb', 'bs', 'nah', 'yue', 'sa', 'kk', 'km',
'vec', 'be', 'diq', 'tk', 'mk', 'nia', 'sm', 'hsb', 'ks', 'shy', 'su',
- 'gd', 'ga', 'bcl', 'an', 'gom', 'mr', 'wo', 'mni', 'ia', 'ang', 'bjn',
- 'mt', 'fo', 'sd', 'tt', 'gn', 'so', 'ie', 'mi', 'csb', 'ug', 'si',
- 'ha', 'st', 'roa-rup', 'hif', 'guw', 'tpi', 'jbo', 'kl', 'zu', 'ay',
- 'yi', 'ln', 'gu', 'na', 'gv', 'kw', 'am', 'ne', 'rw', 'ts', 'ig', 'qu',
- 'ss', 'iu', 'chr', 'gor', 'dv', 'ti', 'tn',
+ 'gd', 'ga', 'bcl', 'an', 'gom', 'mr', 'gor', 'wo', 'mni', 'ia', 'ang',
+ 'bjn', 'mt', 'fo', 'sd', 'tt', 'gn', 'so', 'ie', 'mi', 'csb', 'ug',
+ 'si', 'ha', 'st', 'roa-rup', 'hif', 'guw', 'tpi', 'jbo', 'kl', 'zu',
+ 'ay', 'yi', 'ln', 'gu', 'na', 'gv', 'kw', 'am', 'ne', 'rw', 'ts', 'ig',
+ 'qu', 'ss', 'iu', 'chr', 'dv', 'ti', 'tn',
]
category_redirect_templates = {
To view, visit change 881999. To unsubscribe, or for help writing mail filters, visit settings.