use config.sample.json if config.json doesn't exist
This commit is contained in:
parent
0d162b067b
commit
4438d797e7
6
main.py
6
main.py
|
@ -7,11 +7,15 @@
|
||||||
from mastodon import Mastodon
|
from mastodon import Mastodon
|
||||||
from os import path
|
from os import path
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import os, sqlite3, signal, sys, json, re
|
import os, sqlite3, signal, sys, json, re, shutil
|
||||||
import requests
|
import requests
|
||||||
import functions
|
import functions
|
||||||
|
|
||||||
scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses", "read:notifications"]
|
scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses", "read:notifications"]
|
||||||
|
try:
|
||||||
|
cfg = json.load(open('config.json', 'r'))
|
||||||
|
except:
|
||||||
|
shutil.copy2("config.sample.json", "config.json")
|
||||||
cfg = json.load(open('config.json', 'r'))
|
cfg = json.load(open('config.json', 'r'))
|
||||||
|
|
||||||
#config.json *MUST* contain the instance URL, the instance blacklist (for dead/broken instances), and the CW text. if they're not provided, we'll fall back to defaults.
|
#config.json *MUST* contain the instance URL, the instance blacklist (for dead/broken instances), and the CW text. if they're not provided, we'll fall back to defaults.
|
||||||
|
|
Reference in New Issue