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

static create_empty_file() → bool[source]
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
reload()[source]
save()[source]
save_async()[source]
ttl
type
use_proxy
pyCloudflareUpdater.cached(cached_prop: str)[source]
pyCloudflareUpdater.change_permissions(path: PathT, perms: int, dir_fd=None)[source]
pyCloudflareUpdater.ensure_permissions(path: PathT, perms: int, dir_fd: Optional[int] = None) → bool[source]
pyCloudflareUpdater.get_machine_public_ip()[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

None
Parameters:
  • 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.is_none_or_empty(s: str) → bool[source]
pyCloudflareUpdater.launch(fn: Callable[[...], Awaitable[Any]], *args, **kwargs)[source]
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 from asyncio. In other case, calling parser() will return an Awaitable.

When running this method, the flow is the following:
  1. The arguments, if any, are parsed.
  2. 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.
  3. The logging file will be initialized and starts logging messages.
  4. The daemon’s lock file will be then initialized and created.
  5. The daemon’s context is initialized with the provided configuration. Signal listeners are attached.
  6. The application forks and starts running in background as a daemon.
pyCloudflareUpdater.ucached(cached_prop: str)[source]

Indices and tables