Skip to content

Commit

Permalink
deploy: 5d27a0a
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Jan 7, 2024
1 parent 42bdfdd commit 48a2627
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions config.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,22 @@ <h1 class="title">Module <code>server.config</code></h1>
self.QUEUE_POP_TIME_MOVING_AVG_SIZE = 5

self._defaults = {
key: value for key, value in vars(self).items() if key.isupper()
key: value
for key, value in vars(self).items()
if key.isupper()
}

self._callbacks: dict[str, Callable] = {}
self.refresh()

def refresh(self) -&gt; None:
new_values = self._defaults.copy()
# Add fallback values from environment.
# NOTE: Only works for string values!
for key in new_values:
value = os.getenv(key)
if value is not None:
new_values[key] = value

config_file = os.getenv(&#34;CONFIGURATION_FILE&#34;)
if config_file is not None:
Expand Down Expand Up @@ -406,14 +414,22 @@ <h2 class="section-title" id="header-classes">Classes</h2>
self.QUEUE_POP_TIME_MOVING_AVG_SIZE = 5

self._defaults = {
key: value for key, value in vars(self).items() if key.isupper()
key: value
for key, value in vars(self).items()
if key.isupper()
}

self._callbacks: dict[str, Callable] = {}
self.refresh()

def refresh(self) -&gt; None:
new_values = self._defaults.copy()
# Add fallback values from environment.
# NOTE: Only works for string values!
for key in new_values:
value = os.getenv(key)
if value is not None:
new_values[key] = value

config_file = os.getenv(&#34;CONFIGURATION_FILE&#34;)
if config_file is not None:
Expand Down Expand Up @@ -473,6 +489,12 @@ <h3>Methods</h3>
</summary>
<pre><code class="python">def refresh(self) -&gt; None:
new_values = self._defaults.copy()
# Add fallback values from environment.
# NOTE: Only works for string values!
for key in new_values:
value = os.getenv(key)
if value is not None:
new_values[key] = value

config_file = os.getenv(&#34;CONFIGURATION_FILE&#34;)
if config_file is not None:
Expand Down

0 comments on commit 48a2627

Please sign in to comment.