mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-24 12:49:03 +00:00
Make all doc fragments, module utils, and plugin utils private (#11896)
* Make all doc fragments private. * Make all plugin utils private. * Make all module utils private. * Reformat. * Changelog fragment. * Update configs and ignores. * Adjust unit test names.
This commit is contained in:
parent
9ef1dbb6d5
commit
4fa82b9617
807 changed files with 2041 additions and 1702 deletions
|
|
@ -1,22 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2023 Felix Fontein <felix@fontein.de>
|
||||
# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime as _datetime
|
||||
|
||||
|
||||
def ensure_timezone_info(value: _datetime.datetime) -> _datetime.datetime:
|
||||
if value.tzinfo is not None:
|
||||
return value
|
||||
return value.astimezone(_datetime.timezone.utc)
|
||||
|
||||
|
||||
def fromtimestamp(value: int | float) -> _datetime.datetime:
|
||||
return _datetime.datetime.fromtimestamp(value, tz=_datetime.timezone.utc)
|
||||
|
||||
|
||||
def now() -> _datetime.datetime:
|
||||
return _datetime.datetime.now(tz=_datetime.timezone.utc)
|
||||
Loading…
Add table
Add a link
Reference in a new issue