Commit 42bf33a2daac1898c81455037150b9682af21623

Authored by Alexis Koralewski
1 parent 7b9f2910
Exists in dev

renaming configpyros to ConfigPyros

config/pyros/config_pyros.py
... ... @@ -2,7 +2,7 @@ import yaml,os,time
2 2 import pykwalify.core
3 3 from pykwalify.errors import SchemaError
4 4  
5   -class configpyros:
  5 +class ConfigPyros:
6 6 def check_and_return_config(self,yaml_file:str,schema_file:str)->dict:
7 7 """
8 8 Check if yaml_file is valid for the schema_file and return an dictionary of the config file
... ...
src/core/pyros_django/api/views.py
... ... @@ -37,6 +37,7 @@ class UserViewSet(viewsets.ModelViewSet):
37 37 queryset = PyrosUser.objects.all().order_by('-date_joined')
38 38 serializer_class = UserSerializer
39 39 permission_classes = [IsAuthenticated]
  40 + http_method_names = ["get"]
40 41  
41 42  
42 43 class SequenceViewSet(viewsets.ModelViewSet):
... ... @@ -46,7 +47,7 @@ class SequenceViewSet(viewsets.ModelViewSet):
46 47 queryset = Sequence.objects.all().order_by("-created")
47 48 serializer_class = SequenceSerializer
48 49 permission_classes = [IsAuthenticated]
49   -
  50 + http_method_names = ["get"]
50 51 def get_queryset(self):
51 52 """
52 53 This view should return a list of all the purchases
... ...
src/core/pyros_django/dashboard/views.py
... ... @@ -28,7 +28,7 @@ import time,os
28 28 from src.core.pyros_django.obsconfig.obsconfig_class import OBSConfig
29 29 from django.conf import settings as pyros_settings
30 30 sys.path.append("../../..")
31   -from config.pyros.config_pyros import configpyros
  31 +from config.pyros.config_pyros import ConfigPyros
32 32 #import utils.celme as celme
33 33 import vendor.guitastro as guitastro
34 34  
... ...
src/core/pyros_django/pyros/settings.py
... ... @@ -50,11 +50,11 @@ from datetime import date, datetime
50 50 import django
51 51 # append previous parent folders to import configpyros
52 52 sys.path.append("../../..")
53   -from config.pyros.config_pyros import configpyros
  53 +from config.pyros.config_pyros import ConfigPyros
54 54  
55 55 PYROS_CONFIG_FILE = os.environ.get("pyros_config_file")
56 56 if PYROS_CONFIG_FILE:
57   - CONFIG_PYROS = configpyros(os.environ["pyros_config_file"]).pyros_config
  57 + CONFIG_PYROS = ConfigPyros(os.environ["pyros_config_file"]).pyros_config
58 58 NB_ELEMENT_PER_PAGE = CONFIG_PYROS.get("general").get("nb_element_per_page")
59 59  
60 60 def read_version_number_from_file(version_file:str) -> str:
... ...
src/core/pyros_django/scientific_program/views.py
... ... @@ -19,7 +19,7 @@ from django.views.decorators.csrf import csrf_exempt
19 19 import matplotlib.pyplot as plt
20 20 import re,io,urllib,base64
21 21 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
22   -from config.pyros.config_pyros import configpyros
  22 +from config.pyros.config_pyros import ConfigPyros
23 23 # Scientific program CRUD
24 24  
25 25 #NB_ELEMENT_PER_PAGE = configpyros(os.environ["pyros_config_file"]).pyros_config.get("general").get("nb_element_per_page")
... ...