python-eigen-ingenuity 0.5.28b1__py3-none-any.whl → 0.5.29b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modelbuilder/src/configmanager.py +10 -0
- modelbuilder/src/filemanager.py +51 -7
- {python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/METADATA +1 -1
- {python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/RECORD +7 -7
- {python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/WHEEL +0 -0
- {python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/entry_points.txt +0 -0
- {python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/top_level.txt +0 -0
|
@@ -24,6 +24,8 @@ class ConfigManager:
|
|
|
24
24
|
parser.add_argument('-cs', '--configsection', default='', help='Section of the config file to use, if not DEFAULT')
|
|
25
25
|
parser.add_argument('-d', '--database', default='0', help='Database ID (as set in config file). Defaults to first entry')
|
|
26
26
|
parser.add_argument('-f', '--file', nargs='+', default='', help='List of input files (space separated, quoted with " where necessary)')
|
|
27
|
+
parser.add_argument('-dir', '--directory', nargs='+', default='', help='List of input directories (space separated, quoted with " where necessary)')
|
|
28
|
+
parser.add_argument('-rec', '--recurse_directories', default=False, help='Recurse into subdirectories when processing input directories, or dir references in lst files. Default is False', action='store_true')
|
|
27
29
|
parser.add_argument('-q', '--query', nargs='+', default='', help='List of queries to run (space separated, quoted with " where necessary)')
|
|
28
30
|
parser.add_argument('-pre', '--preprocess', nargs='+', default='', help='Command(s) to execute before processing input files')
|
|
29
31
|
parser.add_argument('-post', '--postprocess', nargs='+', default='', help='Command(s) to execute after processing input files')
|
|
@@ -79,6 +81,8 @@ class ConfigManager:
|
|
|
79
81
|
self.config_file = args.config
|
|
80
82
|
self.config_section = args.configsection
|
|
81
83
|
self.input_file_list = args.file
|
|
84
|
+
self.input_dir_list = args.directory
|
|
85
|
+
self.recurse_dirs = args.recurse_directories
|
|
82
86
|
self.inline_query_list = args.query
|
|
83
87
|
self.preprocess_query_list = args.preprocess
|
|
84
88
|
self.postprocess_query_list = args.postprocess
|
|
@@ -403,6 +407,12 @@ class ConfigManager:
|
|
|
403
407
|
|
|
404
408
|
def get_input_file_list(self):
|
|
405
409
|
return self.input_file_list
|
|
410
|
+
|
|
411
|
+
def get_input_dir_list(self):
|
|
412
|
+
return self.input_dir_list
|
|
413
|
+
|
|
414
|
+
def get_recurse_dirs(self):
|
|
415
|
+
return self.recurse_dirs
|
|
406
416
|
|
|
407
417
|
def get_inline_query_list(self):
|
|
408
418
|
return self.inline_query_list
|
modelbuilder/src/filemanager.py
CHANGED
|
@@ -108,7 +108,7 @@ class FileManager:
|
|
|
108
108
|
info_message(file_processor.get_filename(), ' not processed as requested')
|
|
109
109
|
|
|
110
110
|
def analyse_lst_file(self, filename, def_section=''):
|
|
111
|
-
|
|
111
|
+
recurse_dirs = self.config_manager.get_recurse_dirs()
|
|
112
112
|
f_name = amu.find_file(self.config_manager.get_default_path(), filename)
|
|
113
113
|
current_section = self.section
|
|
114
114
|
self.section = def_section
|
|
@@ -116,9 +116,29 @@ class FileManager:
|
|
|
116
116
|
lst_file = open(f_name, 'r')
|
|
117
117
|
for a_file in lst_file:
|
|
118
118
|
if not a_file.startswith('#') and a_file != '\n':
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
if os.path.isdir(a_file.strip()):
|
|
120
|
+
# Directory specified - add all .csv files in the directory, recursively
|
|
121
|
+
dir_name = a_file.strip()
|
|
122
|
+
if recurse_dirs:
|
|
123
|
+
for root, dirs, files in os.walk(dir_name):
|
|
124
|
+
for dir in dirs:
|
|
125
|
+
dir, section = self.check_section(os.path.join(root, dir), self.config_section)
|
|
126
|
+
if dir != '':
|
|
127
|
+
self.analyse_lst_file(dir, section)
|
|
128
|
+
for file in files:
|
|
129
|
+
file, section = self.check_section(os.path.join(root, file), self.config_section)
|
|
130
|
+
if file != '':
|
|
131
|
+
self.analyse_a_file(file, section)
|
|
132
|
+
|
|
133
|
+
else:
|
|
134
|
+
for file in os.listdir(dir_name):
|
|
135
|
+
file, section = self.check_section(os.path.join(dir_name, file), self.config_section)
|
|
136
|
+
if file != '' and file.endswith('.csv'):
|
|
137
|
+
self.analyse_a_file(file, section)
|
|
138
|
+
else:
|
|
139
|
+
file, section = self.check_section(a_file, self.config_section)
|
|
140
|
+
if file != '':
|
|
141
|
+
self.analyse_a_file(file, section)
|
|
122
142
|
lst_file.close()
|
|
123
143
|
else:
|
|
124
144
|
warning_message(f'{filename} not found')
|
|
@@ -145,7 +165,7 @@ class FileManager:
|
|
|
145
165
|
|
|
146
166
|
labels_to_delete_list = self.config_manager.get_labels_to_delete_list()
|
|
147
167
|
if labels_to_delete_list == []:
|
|
148
|
-
query =
|
|
168
|
+
query = 'MATCH (n) DETACH DELETE n'
|
|
149
169
|
query_processor = CypherFileProcessor(query, self.config_manager, True)
|
|
150
170
|
self.add_file_to_process_list(query_processor, 'pre')
|
|
151
171
|
else:
|
|
@@ -168,12 +188,36 @@ class FileManager:
|
|
|
168
188
|
# Analyse each of the specified input .csv files to determine if they contain Nodes or Relationships
|
|
169
189
|
# If the file doesn't have a valid combination of columns (or is missing) they are placed in the appropriate list
|
|
170
190
|
file_list = self.config_manager.get_input_file_list()
|
|
191
|
+
dir_list = self.config_manager.get_input_dir_list()
|
|
192
|
+
recurse_dirs = self.config_manager.get_recurse_dirs()
|
|
193
|
+
|
|
171
194
|
for a_file in file_list:
|
|
172
195
|
a_file_split = a_file.split(',')
|
|
173
196
|
for a_split_file in a_file_split:
|
|
174
197
|
if a_split_file != '':
|
|
175
198
|
self.analyse_a_file(a_split_file.strip(), self.config_section)
|
|
176
|
-
|
|
199
|
+
|
|
200
|
+
for a_dir in dir_list:
|
|
201
|
+
a_dir_split = a_dir.split(',')
|
|
202
|
+
for a_split_dir in a_dir_split:
|
|
203
|
+
if a_split_dir != '':
|
|
204
|
+
if recurse_dirs:
|
|
205
|
+
for root, dirs, files in os.walk(a_split_dir.strip()):
|
|
206
|
+
for dir in dirs:
|
|
207
|
+
dir, section = self.check_section(os.path.join(root, dir), self.config_section)
|
|
208
|
+
if dir != '':
|
|
209
|
+
self.analyse_lst_file(dir, section)
|
|
210
|
+
for file in files:
|
|
211
|
+
file, section = self.check_section(os.path.join(root, file), self.config_section)
|
|
212
|
+
if file != '':
|
|
213
|
+
self.analyse_a_file(file, section)
|
|
214
|
+
|
|
215
|
+
else:
|
|
216
|
+
for file in os.listdir(a_split_dir.strip()):
|
|
217
|
+
file, section = self.check_section(os.path.join(a_split_dir.strip(), file), self.config_section)
|
|
218
|
+
if file != '' and file.endswith('.csv'):
|
|
219
|
+
self.analyse_a_file(file, section)
|
|
220
|
+
|
|
177
221
|
query_list = self.config_manager.get_inline_query_list()
|
|
178
222
|
for a_query in query_list:
|
|
179
223
|
if a_query is not None:
|
|
@@ -451,7 +495,7 @@ class FileManager:
|
|
|
451
495
|
file_results.set_status(result.get_status())
|
|
452
496
|
break
|
|
453
497
|
else:
|
|
454
|
-
info_message(
|
|
498
|
+
info_message('No changes made by ', query.text)
|
|
455
499
|
|
|
456
500
|
if query.type == 'batch node':
|
|
457
501
|
batch_info = f'{query.batch_size} nodes, {query.property_count} properties, '
|
{python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/RECORD
RENAMED
|
@@ -40,11 +40,11 @@ modelbuilder/src/__init__.py,sha256=bMvb-E_plw2dz9_TYIPevQuvDNmKtW0dmBgnQE9ylwc,
|
|
|
40
40
|
modelbuilder/src/assetmodelbuilder.py,sha256=92Yu9CvmObPYDdqCpn8eBCaZ_KGBhm307YsFt6cg2Eg,8886
|
|
41
41
|
modelbuilder/src/assetmodelcsvwriter.py,sha256=GKNi_fw7AlY-UG2XhwFIS34Ff3XiVRss-o5MUzyJSV0,1071
|
|
42
42
|
modelbuilder/src/assetmodelutilities.py,sha256=S_q5F7mVulk13zCeC1A8cLkJDXj_BR5_yFi3vTw3xUQ,1746
|
|
43
|
-
modelbuilder/src/configmanager.py,sha256=
|
|
43
|
+
modelbuilder/src/configmanager.py,sha256=PbqzYwav6rAm-3Wd8JegYuEEY44iugC_IQ45abUkGbI,30789
|
|
44
44
|
modelbuilder/src/csvcontentsmanager.py,sha256=rVJmR6cPZMS851GeCsRgKzY7b6E_wdbM24rvS0c2feA,7838
|
|
45
45
|
modelbuilder/src/csvwriter.py,sha256=2Xc6kdV6cYwCjrVF6WaZfS6tVp8-oc0ksIHSOx6iqj8,14132
|
|
46
46
|
modelbuilder/src/fileanalyser.py,sha256=L7x44NmOaD0spXO9GLAWrGTp-npM8T0xCqCYesMGHgU,4301
|
|
47
|
-
modelbuilder/src/filemanager.py,sha256=
|
|
47
|
+
modelbuilder/src/filemanager.py,sha256=nfRQlW-AIp8ICu1CO0MO55OyWMWDQJrW4Z8yRRhBs-k,26454
|
|
48
48
|
modelbuilder/src/messages.py,sha256=6JnW-ke6nHGUA4hTEBvo_kVlNJTXoV4LWw8mNwMpBCQ,1325
|
|
49
49
|
modelbuilder/src/property.py,sha256=MQ2jY3EKvPAIF-bWKrkrXj55I3AW1eujAnY4pkw_4IE,11441
|
|
50
50
|
modelbuilder/src/querymanager.py,sha256=Wr0LcY7iCwmLyeSx8LcdbQT2xt1viltp6XFvP3Bg5v8,3270
|
|
@@ -88,8 +88,8 @@ regressiontests/eigeningenuity/historian-multi/test_getRawDatapoints.py,sha256=f
|
|
|
88
88
|
regressiontests/eigeningenuity/historian-multi/test_listDataTags.py,sha256=TcceNSjCKoiK5SJcgTH2JXfKLYxIHdQdwZWlkpGnEVM,2006
|
|
89
89
|
regressiontests/eigeningenuity/historian-multi/test_tagManagement.py,sha256=ylInBt453d1RaSih1eTTxGPZmb60UK4vMwI3UW-U1JY,4830
|
|
90
90
|
regressiontests/eigeningenuity/historian-multi/test_writePoints.py,sha256=51tfUSLUqLKcCKJ1EyhjfzoC_4OP6n1oL3zgTSkXu4s,2696
|
|
91
|
-
python_eigen_ingenuity-0.5.
|
|
92
|
-
python_eigen_ingenuity-0.5.
|
|
93
|
-
python_eigen_ingenuity-0.5.
|
|
94
|
-
python_eigen_ingenuity-0.5.
|
|
95
|
-
python_eigen_ingenuity-0.5.
|
|
91
|
+
python_eigen_ingenuity-0.5.29b1.dist-info/METADATA,sha256=QPLpg6vx1IHUfMtVYc-rkpf6IaZBLeoILABSx9LwIXw,8124
|
|
92
|
+
python_eigen_ingenuity-0.5.29b1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
93
|
+
python_eigen_ingenuity-0.5.29b1.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
|
|
94
|
+
python_eigen_ingenuity-0.5.29b1.dist-info/top_level.txt,sha256=oDWOSmlNPKNBlIEKP8_JaV01O60jTcUIt2tDkq3OD18,56
|
|
95
|
+
python_eigen_ingenuity-0.5.29b1.dist-info/RECORD,,
|
{python_eigen_ingenuity-0.5.28b1.dist-info → python_eigen_ingenuity-0.5.29b1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|