Skip to content

Commit

Permalink
Update options_class.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin authored Jun 8, 2024
1 parent bf5878a commit b99bf06
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions evdspy/EVDSlocal/components/options_class.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from evdspy.EVDSlocal.common.files import Read
from pathlib import Path

from typing import Union, List

#!/usr/bin/python
# -*- coding: utf-8 -*-
from dataclasses import dataclass
"""
Usage :
SingletonOptions().set("default_start_date_user", "UserStartDate")
Expand All @@ -25,12 +26,9 @@
default_cache = "daily" # nocache / hourly
default_end_date = "01-12-2030"
default_start_date = "01-01-2019"
import os
# USERNAME = os.getenv("USERNAME") # or hard coded "Username"
else:
from ..config.config import *
from ..initial.start_options import *
from typing import Union, List
class Options:
def __init__(self,
default_start_date: str,
Expand Down Expand Up @@ -60,7 +58,6 @@ def __init__(self,
# default_cache_user: Union[str, None]
# avoid_absolute_paths: bool = True
# avoid_absolute_paths_user: bool = True
from pathlib import Path
def load_options():
options_ = Options(
default_start_date=default_start_date,
Expand Down Expand Up @@ -111,7 +108,6 @@ def get_valid_value(self, attr: str):
if not user_preferred_value_or_default:
user_preferred_value_or_default = self.getitem(f"{attr}", None)
return user_preferred_value_or_default
from evdspy.EVDSlocal.common.files import Read, Write
notsetyet = "not set yet OptionsClassfile"
class NotSetYet:
def __str__(self):
Expand All @@ -134,7 +130,7 @@ def read_user_options_on_load():
SingletonOptions().set("default_end_date_user", cls.options_.default_end_date)
SingletonOptions().set("avoid_absolute_paths_user", cls.options_.avoid_absolute_paths_user)
# raise "file"
print("user options file was not found. Program will continue with default options...")
# print("user options file was not found. Program will continue with default options...")
return
def read_options_file():
cont = Read(file_name, "could not read ")
Expand Down Expand Up @@ -177,4 +173,4 @@ def notest():
print(a3.get_valid_value("default_start_date"))
print(a3.get_valid_value("default_cache"))
# notest()
read_user_options_on_load()
read_user_options_on_load()

0 comments on commit b99bf06

Please sign in to comment.