diff options
Diffstat (limited to 'maintenance')
-rw-r--r-- | maintenance/__init__.py | 0 | ||||
-rw-r--r-- | maintenance/admin.py | 6 | ||||
-rw-r--r-- | maintenance/apps.py | 8 | ||||
-rw-r--r-- | maintenance/management/__init__.py | 0 | ||||
-rw-r--r-- | maintenance/management/commands/__init__.py | 1 | ||||
-rw-r--r-- | maintenance/management/commands/log_generator.py | 20 | ||||
-rw-r--r-- | maintenance/migrations/__init__.py | 0 | ||||
-rw-r--r-- | maintenance/models.py | 6 | ||||
-rw-r--r-- | maintenance/tests.py | 6 | ||||
-rw-r--r-- | maintenance/views.py | 6 |
10 files changed, 53 insertions, 0 deletions
diff --git a/maintenance/__init__.py b/maintenance/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/maintenance/__init__.py diff --git a/maintenance/admin.py b/maintenance/admin.py new file mode 100644 index 0000000..13be29d --- /dev/null +++ b/maintenance/admin.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.contrib import admin + +# Register your models here. diff --git a/maintenance/apps.py b/maintenance/apps.py new file mode 100644 index 0000000..4262aa8 --- /dev/null +++ b/maintenance/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class MaintenanceConfig(AppConfig): + name = 'maintenance' diff --git a/maintenance/management/__init__.py b/maintenance/management/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/maintenance/management/__init__.py diff --git a/maintenance/management/commands/__init__.py b/maintenance/management/commands/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/maintenance/management/commands/__init__.py @@ -0,0 +1 @@ + diff --git a/maintenance/management/commands/log_generator.py b/maintenance/management/commands/log_generator.py new file mode 100644 index 0000000..95c03d0 --- /dev/null +++ b/maintenance/management/commands/log_generator.py @@ -0,0 +1,20 @@ +#Dev/KoDe :) + +import csv +import datetime +import os +import sys +from django.core.management.base import BaseCommand, CommandError + +class Command(BaseCommand): + args = '' + help = 'Creates Log' + + def handle(self, *args, **options): + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sbhs_server.settings") # To make a Django Environment. + + from sbhs_server.tables.models import Board + board_details = Board.objects.values_list("online", flat=True) + board = str([x for x in board_details]) + with open('new.csv', "a") as newcsv: + newcsv.write("{0} {1} \n".format(datetime.datetime.now(), board.replace(",", "").replace("[", "").replace("]",""))) diff --git a/maintenance/migrations/__init__.py b/maintenance/migrations/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/maintenance/migrations/__init__.py diff --git a/maintenance/models.py b/maintenance/models.py new file mode 100644 index 0000000..1dfab76 --- /dev/null +++ b/maintenance/models.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models + +# Create your models here. diff --git a/maintenance/tests.py b/maintenance/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/maintenance/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/maintenance/views.py b/maintenance/views.py new file mode 100644 index 0000000..e784a0b --- /dev/null +++ b/maintenance/views.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. |