Merge pull request #266 from hjiang/pr-check-dir
only create directory for stocks when necessary
This commit is contained in:
commit
00b244a287
@ -82,11 +82,11 @@ class Stocks(inkycal_module):
|
|||||||
tmpPath = '/tmp/inkycal_stocks/'
|
tmpPath = '/tmp/inkycal_stocks/'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.mkdir(tmpPath)
|
if not os.path.exists(tmpPath):
|
||||||
|
os.mkdir(tmpPath)
|
||||||
|
print(f"Successfully created tmp directory {tmpPath} ")
|
||||||
except OSError:
|
except OSError:
|
||||||
print(f"Creation of tmp directory {tmpPath} failed")
|
print(f"Creation of tmp directory {tmpPath} failed")
|
||||||
else:
|
|
||||||
print(f"Successfully created tmp directory {tmpPath} ")
|
|
||||||
|
|
||||||
# Check if internet is available
|
# Check if internet is available
|
||||||
if internet_available() == True:
|
if internet_available() == True:
|
||||||
|
Loading…
Reference in New Issue
Block a user