mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-08-27 01:32:32 +00:00
This commit fixes the style issues introduced in 7cf729d
according to the output
from black and autopep8.
Details: https://deepsource.io/gh/GradienceTeam/Gradience/transform/ca6ade89-7037-4252-b2a6-c3adad8825d7/
24 lines
616 B
Python
24 lines
616 B
Python
from .utils import buglog, to_slug_case
|
|
from .preset import Preset
|
|
import os
|
|
|
|
PRESET_DIR = os.path.join(
|
|
os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"),
|
|
"presets",
|
|
)
|
|
|
|
|
|
class Repo:
|
|
presets = {}
|
|
|
|
def __init__(self, name):
|
|
self.name = to_slug_case(name)
|
|
self.path = os.path.join(PRESET_DIR, name)
|
|
self.presets = self.get_presets()
|
|
|
|
def get_presets(self):
|
|
presets = {}
|
|
for preset in os.listdir(self.path):
|
|
if preset.endswith(".json"):
|
|
presets[preset[:-5]] = Preset(preset[:-5], self.name)
|
|
return presets
|