Welcome to pyCloudflareUpdater’s documentation!¶
-
class
pyCloudflareUpdater.
Cloudflare
(preferences: pyCloudflareUpdater.preferences.daemon_preferences.Preferences)[source]¶ Bases:
object
-
identifier
¶
-
ip
¶
-
zone
¶
-
-
class
pyCloudflareUpdater.
Preferences
[source]¶ Bases:
object
-
classmethod
create_from_args
(p_args: argparse.Namespace) → pyCloudflareUpdater.preferences.daemon_preferences.Preferences[source]¶
-
domain
¶
-
file
= '/home/javinator9889/.config/cloudflare-ddns.ini'¶
-
frequency
¶
-
key
¶
-
logging_file
¶
-
logging_level
¶
-
mail
¶
-
name
¶
-
pid_file
¶
-
ttl
¶
-
type
¶
-
use_proxy
¶
-
classmethod
-
pyCloudflareUpdater.
ensure_permissions
(path: PathT, perms: int, dir_fd: Optional[int] = None) → bool[source]¶
-
pyCloudflareUpdater.
init_logging
(logger_name: Optional[str] = None, log_file: Optional[str] = 'cloudflare-ddns.log', console_level: int = 10, file_level: int = 10, log_format: str = '%(asctime)s | [%(levelname)s]:\t%(message)s', log_to_console: bool = False) → <module 'logging' from '/usr/lib/python3.8/logging/__init__.py'>[source]¶ Creates a custom logging that outputs to both console and file, if filename provided. Automatically cleans-up old logs during runtime and allows customization of both console and file levels in addition to the formatter. :param logger_name: the logger name for later obtaining it. :param log_file: a filename for saving the logs during execution - can be
NoneParameters: - console_level – the logging level for console.
- file_level – the logging level for the file.
- log_format – the logging format.
- log_to_console – whether to log to a console or not.
Returns: the created logging instance
-
pyCloudflareUpdater.
main
(preferences: pyCloudflareUpdater.preferences.daemon_preferences.Preferences, log: logging.Logger, single_run: bool = False)[source]¶
-
pyCloudflareUpdater.
parser
()[source]¶ Entrypoint for the Cloudflare’s client. This function parses the provided command line arguments and launches the daemon. This function is
async
which means it must be called fromasyncio
. In other case, callingparser()
will return anAwaitable
.- When running this method, the flow is the following:
- The arguments, if any, are parsed.
- Then,
create_from_args()
is called with the provided arguments. If no args are given, then the configuration file is read. If no configuration file exists, the function will fail and the missing key will be printed. - The logging file will be initialized and starts logging messages.
- The daemon’s lock file will be then initialized and created.
- The daemon’s context is initialized with the provided configuration. Signal listeners are attached.
- The application forks and starts running in background as a daemon.