From 9b86ed70b65feddd15c480ee6aa4c80f9238a497 Mon Sep 17 00:00:00 2001 From: Bugazelle Date: Mon, 14 Mar 2022 17:43:25 +0800 Subject: [PATCH] [Fix] Fix -v issue --- README.md | 2 +- src/ExportCsvToInflux/__init__.py | 2 ++ src/ExportCsvToInflux/__version__.py | 2 +- src/ExportCsvToInflux/command_object.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aa85b7d..d94e8b8 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ timestamp,url,response_time
export_csv_to_influx \
--csv demo.csv \
--dbname demo \
--measurement demo \
--tag_columns url \
--field_columns response_time \
--user admin \
--password admin \
--server 127.0.0.1:8086 \
--drop_database=True
-
 // The Read/Write API Token cannot create database. Before you using the --drop_database, make sure your toke have the access  
// See the bug here: https://github.com/influxdata/influxdb/issues/23170
export_csv_to_influx \
--csv demo.csv \
--org my-org \
--bucket my-bucket \
--measurement demo \
--tag_columns url \
--field_columns response_time \
--token YourToken \
--server 127.0.0.1:8086 \
--drop_database=True
+
 // The Read/Write API Token cannot create bucket. Before you using the --drop_database, make sure your toke have the access  
// See the bug here: https://github.com/influxdata/influxdb/issues/23170
export_csv_to_influx \
--csv demo.csv \
--org my-org \
--bucket my-bucket \
--measurement demo \
--tag_columns url \
--field_columns response_time \
--token YourToken \
--server 127.0.0.1:8086 \
--drop_database=True
diff --git a/src/ExportCsvToInflux/__init__.py b/src/ExportCsvToInflux/__init__.py index 29b13bc..92ddeb8 100644 --- a/src/ExportCsvToInflux/__init__.py +++ b/src/ExportCsvToInflux/__init__.py @@ -3,3 +3,5 @@ from .exporter_object import ExporterObject from .base_object import BaseObject from .__version__ import __version__ +from .config_object import Configuration +from .command_object import export_csv_to_influx diff --git a/src/ExportCsvToInflux/__version__.py b/src/ExportCsvToInflux/__version__.py index fc79d63..020ed73 100644 --- a/src/ExportCsvToInflux/__version__.py +++ b/src/ExportCsvToInflux/__version__.py @@ -1 +1 @@ -__version__ = '0.2.1' +__version__ = '0.2.2' diff --git a/src/ExportCsvToInflux/command_object.py b/src/ExportCsvToInflux/command_object.py index 4fd6538..f1217c9 100644 --- a/src/ExportCsvToInflux/command_object.py +++ b/src/ExportCsvToInflux/command_object.py @@ -14,6 +14,7 @@ def export_csv_to_influx(): # Parse: Parse the server name, and judge the influx version parser.add_argument('-s', '--server', nargs='?', default='localhost:8086', const='localhost:8086', help='InfluxDB Server address. Default: localhost:8086') + parser.add_argument('-v', '--version', action="version", version=__version__) user_namespace = UserNamespace() parser.parse_known_args(namespace=user_namespace) influx_object = InfluxObject(db_server_name=user_namespace.server) @@ -99,7 +100,6 @@ def export_csv_to_influx(): help='Write duplicated points. Default: False.') parser.add_argument('--csv_charset', '--csv_charset', nargs='?', default=None, const=None, help='The csv charset. Default: None, which will auto detect') - parser.add_argument('-v', '--version', action="version", version=__version__) args = parser.parse_args(namespace=user_namespace) exporter = ExporterObject()