Skip to content

Commit

Permalink
Merge pull request #8 from Bugazelle/dev
Browse files Browse the repository at this point in the history
[Feat] Release to v0.1.13
  • Loading branch information
Bugazelle authored Jul 19, 2019
2 parents 74059d2 + b142b05 commit a8f5cc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ExportCsvToInflux/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.11'
__version__ = '0.1.13'
6 changes: 3 additions & 3 deletions src/ExportCsvToInflux/csv_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_csv_header(self, file_name):
return headers

@staticmethod
def search_files_in_dir(directory, match_suffix='.csv', filter_pattern='influx.csv'):
def search_files_in_dir(directory, match_suffix='.csv', filter_pattern='_influx.csv'):
"""Function: search_files_in_dir
:param directory: the directory
Expand All @@ -44,8 +44,8 @@ def search_files_in_dir(directory, match_suffix='.csv', filter_pattern='influx.c
"""

base_object = BaseObject()
match_suffix = base_object.str_to_list(match_suffix)
filter_pattern = base_object.str_to_list(filter_pattern)
match_suffix = base_object.str_to_list(match_suffix, lower=True)
filter_pattern = base_object.str_to_list(filter_pattern, lower=True)

# Is file
is_file = os.path.isfile(directory)
Expand Down
5 changes: 4 additions & 1 deletion src/ExportCsvToInflux/exporter_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ def export_csv_to_influx(self,
if not field_columns:
print('Error: The input --field_columns does not expected. '
'Please check the fields are in csv headers or not. Exporter stopping...')
continue
if not tag_columns:
print('Error: The input --tag_columns does not expected. '
'Please check the fields are in csv headers or not. Exporter stopping...')
continue
match_columns = self.__validate_columns(csv_headers, match_columns)
filter_columns = self.__validate_columns(csv_headers, filter_columns)

Expand All @@ -253,7 +255,8 @@ def export_csv_to_influx(self,
break

# Check the timestamp, and generate the csv with checksum
new_csv_file = 'influx.csv'
csv_base_name = os.path.basename(csv_file_item)
new_csv_file = '{0}_influx.csv'.format(csv_base_name.replace('.csv', ''))
new_csv_file = os.path.join(current_dir, new_csv_file)
new_csv_file_exists = os.path.exists(new_csv_file)
no_new_data_status = False
Expand Down

0 comments on commit a8f5cc6

Please sign in to comment.