-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some rough sketch out of how to add follows/blocks to a Lemmy setting…
…s file See #21
- Loading branch information
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
_*.json | ||
directory.json | ||
|
||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/python3 | ||
import json | ||
|
||
lfile='./lemmy_export.json' | ||
|
||
blks='./blocks.json' | ||
flws='./follows.json' | ||
|
||
wipe_flws = False | ||
wipe_blks = False | ||
|
||
with open(lfile) as l: | ||
settings = json.load(l) | ||
|
||
print(settings['followed_communities']) | ||
print(settings['blocked_communities']) | ||
|
||
if wipe_flws is True: | ||
settings['followed_communities'] = [] | ||
|
||
if wipe_blks is True: | ||
settings['blocked_communities'] = [] | ||
|
||
with open(flws) as f: | ||
follows = json.load(f) | ||
|
||
with open(blks) as b: | ||
blocks = json.load(b) | ||
|
||
settings['followed_communities'].extend(follows) | ||
settings['blocked_communities'].extend(blocks) | ||
|
||
print('----------------') | ||
print(settings['followed_communities']) | ||
print(settings['blocked_communities']) |