Skip to content

Commit 00df016

Browse files
authored
Development (#220)
1 parent f7ce761 commit 00df016

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

tabcmd/commands/auth/session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
import urllib3
88
from urllib3.exceptions import InsecureRequestWarning
99

10+
from tabcmd.version import version
1011
from tabcmd.commands.constants import Errors
1112
from tabcmd.execution.localize import _
1213
from tabcmd.execution.logger_config import log
1314

15+
from typing import Dict, Any
16+
1417

1518
class Session:
1619
"""
@@ -152,7 +155,7 @@ def _set_connection_options(self) -> TSC.Server:
152155
# args still to be handled here:
153156
# proxy, --no-proxy,
154157
# cert
155-
http_options = {}
158+
http_options: Dict[str, Any] = {"headers": {"User-Agent": "Tabcmd/{}".format(version)}}
156159
if self.no_certcheck:
157160
http_options["verify"] = False
158161
urllib3.disable_warnings(category=InsecureRequestWarning)

tabcmd/commands/user/user_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def get_users_from_file(csv_file: io.TextIOWrapper, logger=None) -> List[TSC.Use
206206
def _parse_line(line: str) -> Optional[TSC.UserItem]:
207207
if line is None or line is False or line == "\n" or line == "":
208208
return None
209-
line = line.strip().lower()
209+
line = line.strip()
210210
line_parts: List[str] = line.split(",")
211211
data = Userdata()
212212
values: List[str] = list(map(str.strip, line_parts))

tabcmd/execution/parent_parser.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
import argparse
2-
import logging
32

43
from .localize import _
54
from .logger_config import log
65
from .map_of_commands import CommandsMap
7-
8-
9-
# when we drop python 3.8, this could be replaced with this lighter weight option
10-
# from importlib.metadata import version, PackageNotFoundError
11-
from pkg_resources import get_distribution, DistributionNotFound
12-
13-
try:
14-
version = get_distribution("tabcmd").version
15-
except DistributionNotFound:
16-
version = "2.x.unknown"
17-
pass
18-
6+
from tabcmd.version import version
197

208
"""
219
Note: output order is influenced first by grouping, then by order they are added in here

tabcmd/version.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# when we drop python 3.8, this could be replaced with this lighter weight option
2+
# from importlib.metadata import version, PackageNotFoundError
3+
from pkg_resources import get_distribution, DistributionNotFound
4+
5+
try:
6+
version = get_distribution("tabcmd").version
7+
except DistributionNotFound:
8+
version = "2.0.0"
9+
pass

tests/e2e/online_tests.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ def _get_datasource(self, server_file):
129129
arguments = [command, server_file]
130130
_test_command(arguments)
131131

132-
def _get_datasource(self, server_file):
133-
command = "get"
134-
server_file = "/datasources/" + server_file
135-
arguments = [command, server_file]
136-
_test_command(arguments)
137-
138132
def _create_extract(self, wb_name):
139133
command = "createextracts"
140134
arguments = [command, "-w", wb_name, "--encrypt"]

0 commit comments

Comments
 (0)