Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SpriteLink/NIPAP
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1bb18e0568786bb3824eb1d9753cb260ccdbcb4c
Choose a base ref
..
head repository: SpriteLink/NIPAP
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ba69389760e36a7746aabc5cb277d88928867add
Choose a head ref
Showing with 12 additions and 12 deletions.
  1. +5 −0 pynipap/pynipap/__init__.py
  2. +7 −12 pynipap/pynipap/pynipap.py
5 changes: 5 additions & 0 deletions pynipap/pynipap/__init__.py
Original file line number Diff line number Diff line change
@@ -16,3 +16,8 @@
# If set, the value assigned to the variable below will be used as a bearer
# token.
bearer_token = None

# Caching of objects is enabled per default but can be disabled for certain
# scenarios. Since we don't have any cache expiration time it can be useful to
# disable for long running applications.
CACHE = True
19 changes: 7 additions & 12 deletions pynipap/pynipap/pynipap.py
Original file line number Diff line number Diff line change
@@ -211,16 +211,9 @@

from .tracing import create_span


# This variable holds the URI to the nipap XML-RPC service which will be used.
# It must be set before the Pynipap can be used!
xmlrpc_uri = None
bearer_token = None

# Caching of objects is enabled per default but can be disabled for certain
# scenarios. Since we don't have any cache expiration time it can be useful to
# disable for long running applications.
CACHE = True
# Will be overwritten by import from . when setting up XML-RPC-connection, but
# needs to be defined here if it's read before the connections is set up.
CACHE = False

class AuthOptions:
""" A global-ish authentication option container.
@@ -266,8 +259,10 @@ def __init__(self):
"""

# This is not a pretty solution, but needed to maintain backwards
# compatibility.
from . import xmlrpc_uri, bearer_token
# compatibility and avoiding circular imports.
from . import xmlrpc_uri, bearer_token, CACHE as cache_enabled
CACHE = cache_enabled

if xmlrpc_uri is None:
raise NipapError('XML-RPC URI not specified')