Skip to content

Commit

Permalink
Bug fix: Ini directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tedi committed Jul 24, 2020
1 parent d11dc4f commit c7e6997
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions buildutil/iniparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
class IniParser():

def __init__(self, iniPathFile=None):
self.iniPathFile = iniPathFile
# Validate
if iniPathFile is None:
raise Exception("Test")

self.iniPathFile = os.path.abspath(iniPathFile)
ini = configparser.ConfigParser()
ini.optionxform = str
ini.read(self.iniPathFile)

# Create directory if it does not exist
iniDirpath = os.path.dirname(self.iniPathFile)
if os.path.isdir(iniDirpath) is False:
if os.path.isdir(iniDirpath) == False:
os.makedirs(iniDirpath)

# Create ini file if it does not exist
Expand Down
2 changes: 1 addition & 1 deletion buildutil/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "v0.0.1-3"
__version__ = "v0.0.1-4"
__author__ = "Kanelis Elias"
__email__ = "hkanelhs@yahoo.gr"
__license__ = "MIT"

0 comments on commit c7e6997

Please sign in to comment.