From 21d531095aa73e053840a059af80ae0f28d95882 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Sat, 28 Mar 2020 16:54:06 +0100
Subject: [PATCH] Move util files to own namespace

---
 aleksis/apps/untis/management/commands/untis_import.py | 2 +-
 aleksis/apps/untis/menus.py                            | 2 +-
 aleksis/apps/untis/{ => util/mysql}/datetimeutils.py   | 0
 aleksis/apps/untis/{ => util/mysql}/drive.py           | 0
 aleksis/apps/untis/{ => util/mysql}/events.py          | 2 +-
 aleksis/apps/untis/{ => util/mysql}/parse.py           | 0
 aleksis/apps/untis/{ => util/mysql}/plan.py            | 0
 aleksis/apps/untis/{ => util/mysql}/schoolapps_util.py | 0
 aleksis/apps/untis/{ => util/mysql}/sub.py             | 0
 aleksis/apps/untis/{util.py => util/xml/xml.py}        | 0
 aleksis/apps/untis/views.py                            | 4 ++--
 11 files changed, 5 insertions(+), 5 deletions(-)
 rename aleksis/apps/untis/{ => util/mysql}/datetimeutils.py (100%)
 rename aleksis/apps/untis/{ => util/mysql}/drive.py (100%)
 rename aleksis/apps/untis/{ => util/mysql}/events.py (98%)
 rename aleksis/apps/untis/{ => util/mysql}/parse.py (100%)
 rename aleksis/apps/untis/{ => util/mysql}/plan.py (100%)
 rename aleksis/apps/untis/{ => util/mysql}/schoolapps_util.py (100%)
 rename aleksis/apps/untis/{ => util/mysql}/sub.py (100%)
 rename aleksis/apps/untis/{util.py => util/xml/xml.py} (100%)

diff --git a/aleksis/apps/untis/management/commands/untis_import.py b/aleksis/apps/untis/management/commands/untis_import.py
index 8a263c8..084c12f 100644
--- a/aleksis/apps/untis/management/commands/untis_import.py
+++ b/aleksis/apps/untis/management/commands/untis_import.py
@@ -1,7 +1,7 @@
 from django.core.management.base import BaseCommand
 from django.utils.translation import ugettext as _
 
-from ...util import untis_import_xml
+from aleksis.apps.untis.util.xml.xml import untis_import_xml
 
 
 class Command(BaseCommand):
diff --git a/aleksis/apps/untis/menus.py b/aleksis/apps/untis/menus.py
index 3bda041..e217878 100644
--- a/aleksis/apps/untis/menus.py
+++ b/aleksis/apps/untis/menus.py
@@ -3,7 +3,7 @@ from django.utils.translation import ugettext_lazy as _
 MENUS = {
     "DATA_MANAGEMENT_MENU": [
         {
-            "name": _("Units import"),
+            "name": _("Untis import"),
             "url": "untis_import",
             "validators": [
                 "menu_generator.validators.is_authenticated",
diff --git a/aleksis/apps/untis/datetimeutils.py b/aleksis/apps/untis/util/mysql/datetimeutils.py
similarity index 100%
rename from aleksis/apps/untis/datetimeutils.py
rename to aleksis/apps/untis/util/mysql/datetimeutils.py
diff --git a/aleksis/apps/untis/drive.py b/aleksis/apps/untis/util/mysql/drive.py
similarity index 100%
rename from aleksis/apps/untis/drive.py
rename to aleksis/apps/untis/util/mysql/drive.py
diff --git a/aleksis/apps/untis/events.py b/aleksis/apps/untis/util/mysql/events.py
similarity index 98%
rename from aleksis/apps/untis/events.py
rename to aleksis/apps/untis/util/mysql/events.py
index 66f76c6..5186f28 100644
--- a/aleksis/apps/untis/events.py
+++ b/aleksis/apps/untis/util/mysql/events.py
@@ -4,7 +4,7 @@ from schoolapps.settings import TIMETABLE_HEIGHT
 from .drive import drive
 from .api_helper import untis_date_to_date, date_to_untis_date
 from .api import row_by_row_helper, run_all, get_absence_by_id
-from . import models
+from aleksis.apps.untis import models
 
 
 #########
diff --git a/aleksis/apps/untis/parse.py b/aleksis/apps/untis/util/mysql/parse.py
similarity index 100%
rename from aleksis/apps/untis/parse.py
rename to aleksis/apps/untis/util/mysql/parse.py
diff --git a/aleksis/apps/untis/plan.py b/aleksis/apps/untis/util/mysql/plan.py
similarity index 100%
rename from aleksis/apps/untis/plan.py
rename to aleksis/apps/untis/util/mysql/plan.py
diff --git a/aleksis/apps/untis/schoolapps_util.py b/aleksis/apps/untis/util/mysql/schoolapps_util.py
similarity index 100%
rename from aleksis/apps/untis/schoolapps_util.py
rename to aleksis/apps/untis/util/mysql/schoolapps_util.py
diff --git a/aleksis/apps/untis/sub.py b/aleksis/apps/untis/util/mysql/sub.py
similarity index 100%
rename from aleksis/apps/untis/sub.py
rename to aleksis/apps/untis/util/mysql/sub.py
diff --git a/aleksis/apps/untis/util.py b/aleksis/apps/untis/util/xml/xml.py
similarity index 100%
rename from aleksis/apps/untis/util.py
rename to aleksis/apps/untis/util/xml/xml.py
diff --git a/aleksis/apps/untis/views.py b/aleksis/apps/untis/views.py
index fbea02b..098a681 100644
--- a/aleksis/apps/untis/views.py
+++ b/aleksis/apps/untis/views.py
@@ -5,12 +5,12 @@ from django.shortcuts import render
 from aleksis.core.decorators import admin_required
 
 from .forms import UntisUploadForm
-from .util import untis_import_xml
+from aleksis.apps.untis.util.xml.xml import untis_import_xml
 
 
 @login_required
 @admin_required
-def untis_import(request: HttpRequest) -> HttpResponse:
+def xml_import(request: HttpRequest) -> HttpResponse:
     context = {}
 
     upload_form = UntisUploadForm()
-- 
GitLab