fix : minor issue fixed.

pull/63/head
sadrasabouri 2021-10-22 12:58:52 +03:30
rodzic 0130e3f063
commit 8620db47ef
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -4,7 +4,7 @@
import requests
import io
import json
from .params import Projection, DEFAULT_PROJECTION, VALID_COLORS, NFT_STORAGE_API, NFT_STORAGE_SUCCESS_MESSAGE, FIG_SAVE_SUCCESS_MESSAGE, NO_FIG_ERROR_MESSAGE, DATA_PARSING_ERROR, DATA_TYPE_ERROR, OVERVIEW, CONFIG_SAVE_SUCCESS_MESSAGE
from .params import Projection, DEFAULT_PROJECTION, VALID_COLORS, NFT_STORAGE_API, NFT_STORAGE_SUCCESS_MESSAGE, FIG_SAVE_SUCCESS_MESSAGE, NO_FIG_ERROR_MESSAGE, DATA_PARSING_ERROR, DATA_TYPE_ERROR, OVERVIEW, DATA_SAVE_SUCCESS_MESSAGE
from .errors import samilaDataError
@ -129,7 +129,7 @@ def save_data_file(data1, data2, file_adr):
data = {}
data['data1'] = data1
data['data2'] = data2
result = {"status": True, "message": CONFIG_SAVE_SUCCESS_MESSAGE}
result = {"status": True, "message": DATA_SAVE_SUCCESS_MESSAGE}
try:
with open(file_adr, 'wb') as fp:
json.dump(data, fp)

Wyświetl plik

@ -26,6 +26,7 @@ VALID_COLORS = list(dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS).keys())
NFT_STORAGE_API = "https://api.nft.storage/upload"
NFT_STORAGE_SUCCESS_MESSAGE = "Everything seems good."
FIG_SAVE_SUCCESS_MESSAGE = "Everything seems good."
DATA_SAVE_SUCCESS_MESSAGE = "Everything seems good."
NO_FIG_ERROR_MESSAGE = "No figure was found. First run `generate` and `plot` methods."
DATA_TYPE_ERROR = "Provided data file is not supported. It should be either file or io.IOBase."
DATA_PARSING_ERROR = "Provided data format is wrong. It should be in JSON format including data1 and data2 fields."