Skip to content

Commit

Permalink
Merge pull request #40 from juliushaag/folder-restructure
Browse files Browse the repository at this point in the history
Restructuring of the folders according to "Entwurfsheft"
  • Loading branch information
nils-prommersberger authored Jun 26, 2024
2 parents c14c135 + 3f02619 commit 0104a3e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 19 deletions.
1 change: 1 addition & 0 deletions quafelweb/account_controller/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def get_identifier(self, request):
def is_logged_in(self, request):
raise NotImplementedError()


def RegisterInstance(name : str, auth : "BaseAuthenticator"):
BaseAuthenticator._AUTHENTICATORS[name] = auth

Expand Down
4 changes: 2 additions & 2 deletions quafelweb/account_controller/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import account_controller.kitopenid # This needs to be here
from account_controller import authenticate
from account_controller.models import QuafelAdmin
from account_controller.models import AdminAccount
# Create your views here.

class AccountManager():
Expand All @@ -20,7 +20,7 @@ def _deco(req):
if not AccountManager._AUTH.is_logged_in(req):
return AccountManager._AUTH.authenticate(req, req.build_absolute_uri(reverse('auth')))
ident = AccountManager._AUTH.get_identifier(req)
if QuafelAdmin.objects.contains(QuafelAdmin(ident)):
if AdminAccount.objects.contains(AdminAccount(ident)):
return redirect('denied')
return fn(req)

Expand Down
22 changes: 18 additions & 4 deletions quafelweb/account_controller/views.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@


from django.http import HttpResponse


class AccountView:

# /
def index(request):
def manage_accounts(request) -> HttpResponse:
...

def add_admin(request):
def add_admin(request) -> HttpResponse:
...

def remove_admin(request) -> HttpResponse:
...

def authenticate(request) -> HttpResponse:
...

def authenticate_callback(requests) -> HttpResponse:
...

def get_identifier(request) -> str:
...

def remove_admin(request):
def is_logged_in(request) -> bool:
...
5 changes: 1 addition & 4 deletions quafelweb/hardware_controller/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class HardwareView:

# /hardware
def index(request):
def manage_controllers(request):
...

# /hardware/add with post
Expand All @@ -20,8 +20,5 @@ def remove_profile(request):
def archive_profile(request):
...

# return List of HardwareProfile Ids connected with the request (persistent Links)
def getConst(request):
...


1 change: 1 addition & 0 deletions quafelweb/quafel_simulators/backend/gpu-cluster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from quafel_simulators.simulator import
6 changes: 3 additions & 3 deletions quafelweb/quafel_simulators/simulator.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from abc import ABC
from simulation_data.simulation import SimulationGroup
from simulation_data.simulation import SimulationGroup, HardwareProfile


class Simulator(ABC):

def simulate(self, group : SimulationGroup):
def simulate(self, ip : str, port : int , simulators : list[str], qbits : set[int], ...):
...

def collect(self) -> dict:
...
...
2 changes: 2 additions & 0 deletions quafelweb/simulation_controller/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ def select_environments(request):
def submit_request(request):
...

def claim_results(request):
...
6 changes: 0 additions & 6 deletions quafelweb/simulation_view/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,3 @@ def render_view(request, sim_envs : list[SimulationEnv], sim_confs : dict[str, l
context = { 'environments' : sim_envs }

return render(request, 'index.html', context)


# return Integers of Simulation Data already in database
def getRunnedData(request):
...

0 comments on commit 0104a3e

Please sign in to comment.