File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 22import json
33import logging
44import time
5+ from tkinter import E
56import warnings
67from collections import namedtuple
78from datetime import datetime , timezone
@@ -278,13 +279,11 @@ def _string_from_dict(dictionary: dict, value_with_quotes=False) -> str:
278279
279280 The string will be formatted as {key}: 'value' for each key. Value will be inclusive of
280281 quotations while key will not. This can be toggled with `value_with_quotes`"""
281- if value_with_quotes :
282- return "," .join ([
283- f"""{ c } : "{ dictionary .get (c )} \" """ for c in dictionary
284- if dictionary .get (c )
285- ])
282+
283+ quote = "\" " if value_with_quotes else ""
286284 return "," .join ([
287- f"""{ c } : { dictionary .get (c )} """ for c in dictionary
285+ f"""{ c } : { quote } { dictionary .get (c )} { quote } """
286+ for c in dictionary
288287 if dictionary .get (c )
289288 ])
290289
@@ -293,7 +292,7 @@ def _validate_datetime(string_date: str) -> bool:
293292 if string_date :
294293 try :
295294 datetime .strptime (string_date , "%Y-%m-%d" )
296- except :
295+ except ValueError :
297296 raise ValueError (f"""Incorrect format for: { string_date } .
298297 Format must be \" YYYY-MM-DD\" """ )
299298 return True
You can’t perform that action at this time.
0 commit comments