Skip to content

Commit d9f67e9

Browse files
committed
chore: reformat Python code with 180 char line limit
- Black reformatted with --line-length=180 - Fixed trailing whitespace and EOF issues - Fixed Dockerfile FROM casing (AS instead of as)
1 parent 96af158 commit d9f67e9

4 files changed

Lines changed: 651 additions & 629 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM python:3.11-slim as builder
2+
FROM python:3.11-slim AS builder
33

44
# Install build dependencies
55
RUN apt-get update && apt-get install -y --no-install-recommends \

debug_auth.py

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/usr/bin/env python3
2-
import json
32
import base64
3+
import json
4+
45
import requests
56

67
# Load config
7-
with open('config.json') as f:
8+
with open("config.json") as f:
89
config = json.load(f)
910

10-
reddit = config['reddit']
11+
reddit = config["reddit"]
1112

1213
print("=" * 50)
1314
print("Reddit Auth Debug")
@@ -19,29 +20,18 @@
1920
print(f"Client Secret first 4: {reddit['client_secret'][:4]}...")
2021

2122
# Check for common issues
22-
if len(reddit['client_id']) > 20:
23+
if len(reddit["client_id"]) > 20:
2324
print("⚠️ Client ID seems too long - might be using secret as ID?")
24-
if len(reddit['client_secret']) < 20:
25+
if len(reddit["client_secret"]) < 20:
2526
print("⚠️ Client Secret seems too short - might be using ID as secret?")
2627

2728
# Test manual auth
2829
print("\nTesting manual authentication...")
2930
auth = base64.b64encode(f"{reddit['client_id']}:{reddit['client_secret']}".encode()).decode()
30-
headers = {
31-
"Authorization": f"Basic {auth}",
32-
"User-Agent": f"ModlogWikiPublisher/1.0 by /u/{reddit['username']}"
33-
}
34-
data = {
35-
"grant_type": "password",
36-
"username": reddit['username'],
37-
"password": reddit['password']
38-
}
39-
40-
response = requests.post(
41-
"https://www.reddit.com/api/v1/access_token",
42-
headers=headers,
43-
data=data
44-
)
31+
headers = {"Authorization": f"Basic {auth}", "User-Agent": f"ModlogWikiPublisher/1.0 by /u/{reddit['username']}"}
32+
data = {"grant_type": "password", "username": reddit["username"], "password": reddit["password"]}
33+
34+
response = requests.post("https://www.reddit.com/api/v1/access_token", headers=headers, data=data)
4535

4636
print(f"\nResponse Status: {response.status_code}")
4737
print(f"Response Headers: {dict(response.headers)}")
@@ -53,4 +43,4 @@
5343
print("2. Client ID = the string under 'personal use script' (shorter)")
5444
print("3. Client Secret = the 'secret' field (longer)")
5545
print("4. Make sure the app type is 'script' not 'web app'")
56-
print("5. Username should be just 'Bakerboy448' not 'u/Bakerboy448'")
46+
print("5. Username should be just 'Bakerboy448' not 'u/Bakerboy448'")

0 commit comments

Comments
 (0)