Skip to content

Commit

Permalink
Flatten packages out to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexeh committed Feb 6, 2024
1 parent 49dcd6d commit 5beb4ba
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 114 deletions.
Empty file.
106 changes: 0 additions & 106 deletions joystick_diagrams/classes/export.py

This file was deleted.

Empty file.
11 changes: 3 additions & 8 deletions joystick_diagrams/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from pathlib import Path
from typing import Any

from joystick_diagrams import utils
from joystick_diagrams.db.db_device_management import get_device_template_path
from joystick_diagrams.input.device import Device_
from joystick_diagrams.input.profile import Profile_
Expand Down Expand Up @@ -72,15 +73,9 @@ def export_devices_to_templates(devices: dict[str, dict[str, Any]], profile_name
save_template(result, file_name)


def create_directory_if_not_exists(directory: Path):
if directory.exists():
return

Path.mkdir(directory)


def save_template(template_data, file_name):
create_directory_if_not_exists(EXPORT_DIRECTORY)
utils.create_directory(EXPORT_DIRECTORY)

with open(EXPORT_DIRECTORY.joinpath(file_name), "w", encoding="UTF-8") as f:
f.write(template_data)

Expand Down
Empty file.
File renamed without changes.
File renamed without changes.

0 comments on commit 5beb4ba

Please sign in to comment.