Skip to content

Commit 4a21743

Browse files
committed
fix: trim trailing whitespace and fix end of file in nextdns_sync.py
1 parent 3fbed19 commit 4a21743

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

nextdns_sync.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ def setup_logger(name: str) -> logging.Logger:
3737
"""Sets up a logger with a given name."""
3838
logger = logging.getLogger(name)
3939
logger.setLevel(logging.DEBUG) # Set to DEBUG to capture all messages
40-
40+
4141
# Create a stream handler and set its format
4242
handler = logging.StreamHandler()
4343
formatter = logging.Formatter('%(asctime)s|%(levelname)s|%(message)s')
4444
handler.setFormatter(formatter)
45-
45+
4646
# Add the handler if it doesn't already exist
4747
if not logger.hasHandlers():
4848
logger.addHandler(handler)
49-
49+
5050
return logger
5151

5252
logger = setup_logger(__name__)
@@ -74,7 +74,7 @@ def api_request(method: str, url: str, headers: Optional[Dict[str, str]] = None,
7474
logger.info("[API CALL] USING %s", method)
7575
if data is not None:
7676
logger.info("[API CALL] Using payload %s", json.dumps(data, separators=(',', ':')))
77-
77+
7878
try:
7979
response = requests.request(method, url, headers=headers, data=data, json=json, timeout=timeout)
8080
response.raise_for_status()
@@ -144,10 +144,10 @@ def sync_profiles(keys_to_sync: List[str], payload: Optional[Dict] = None) -> No
144144
settings = fetch_profile_settings(PROFILE_MAIN)
145145
data = settings['data']
146146
logger.info("[SYNC] Settings from Profile %s", PROFILE_MAIN)
147-
147+
148148
if payload is None:
149149
payload = build_payload(data, keys_to_sync)
150-
150+
151151
payload = alpha_sort_lists(payload)
152152
logger.debug("[SYNC] Generated Payload: %s", json.dumps(payload, separators=(',', ':')))
153153

@@ -212,4 +212,4 @@ def main():
212212

213213
if __name__ == "__main__":
214214
logging.basicConfig(level=logging.INFO, format="%(levelname)s | %(message)s")
215-
main()
215+
main()

0 commit comments

Comments
 (0)