Skip to content

Commit

Permalink
#3 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed May 29, 2021
1 parent 0cf5566 commit 97dec32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
[markdownlint](https://dlaa.me/markdownlint/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2018-12-07

### Changed in 1.2.0

- Shipped with SenzingAPI 1.4.0

## [1.0.0] - 2018-09-18

### Added to 1.0.0
Expand Down
18 changes: 11 additions & 7 deletions G2ConfigTables.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ class G2ConfigTables:


#----------------------------------------
def __init__(self, configFile,g2iniPath):
def __init__(self, configFile,g2iniPath,configuredDatasourcesOnly=False):
self.configFileName = configFile
self.g2iniPath = g2iniPath
self.success = True
self.configuredDatasourcesOnly = configuredDatasourcesOnly


#----------------------------------------
Expand Down Expand Up @@ -86,12 +87,15 @@ def addDataSource(self, dataSource):
for dsrcNode in dsrcListNode:
if dsrcNode.upper() == dataSource:
dsrcExists = True
if dsrcExists == False:
g2_config_module.addDataSource(configHandle,dataSource)
newConfig = g2_config_module.save(configHandle)
with open(self.configFileName, 'w') as data_file2:
json.dump(json.loads(newConfig),data_file2, indent=4)
returnCode = 1
if dsrcExists == False :
if self.configuredDatasourcesOnly == False:
g2_config_module.addDataSource(configHandle,dataSource)
newConfig = g2_config_module.save(configHandle)
with open(self.configFileName, 'w') as data_file2:
json.dump(json.loads(newConfig),data_file2, indent=4)
returnCode = 1
else:
raise G2Exception.UnconfiguredDataSourceException(dataSource)
g2_config_module.close(configHandle)
g2_config_module.destroy()
del g2_config_module
Expand Down

0 comments on commit 97dec32

Please sign in to comment.