Skip to content

Commit

Permalink
Development (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhuvneshdev authored Jan 6, 2023
1 parent f7ce761 commit 00df016
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
5 changes: 4 additions & 1 deletion tabcmd/commands/auth/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
import urllib3
from urllib3.exceptions import InsecureRequestWarning

from tabcmd.version import version
from tabcmd.commands.constants import Errors
from tabcmd.execution.localize import _
from tabcmd.execution.logger_config import log

from typing import Dict, Any


class Session:
"""
Expand Down Expand Up @@ -152,7 +155,7 @@ def _set_connection_options(self) -> TSC.Server:
# args still to be handled here:
# proxy, --no-proxy,
# cert
http_options = {}
http_options: Dict[str, Any] = {"headers": {"User-Agent": "Tabcmd/{}".format(version)}}
if self.no_certcheck:
http_options["verify"] = False
urllib3.disable_warnings(category=InsecureRequestWarning)
Expand Down
2 changes: 1 addition & 1 deletion tabcmd/commands/user/user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_users_from_file(csv_file: io.TextIOWrapper, logger=None) -> List[TSC.Use
def _parse_line(line: str) -> Optional[TSC.UserItem]:
if line is None or line is False or line == "\n" or line == "":
return None
line = line.strip().lower()
line = line.strip()
line_parts: List[str] = line.split(",")
data = Userdata()
values: List[str] = list(map(str.strip, line_parts))
Expand Down
14 changes: 1 addition & 13 deletions tabcmd/execution/parent_parser.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import argparse
import logging

from .localize import _
from .logger_config import log
from .map_of_commands import CommandsMap


# when we drop python 3.8, this could be replaced with this lighter weight option
# from importlib.metadata import version, PackageNotFoundError
from pkg_resources import get_distribution, DistributionNotFound

try:
version = get_distribution("tabcmd").version
except DistributionNotFound:
version = "2.x.unknown"
pass

from tabcmd.version import version

"""
Note: output order is influenced first by grouping, then by order they are added in here
Expand Down
9 changes: 9 additions & 0 deletions tabcmd/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# when we drop python 3.8, this could be replaced with this lighter weight option
# from importlib.metadata import version, PackageNotFoundError
from pkg_resources import get_distribution, DistributionNotFound

try:
version = get_distribution("tabcmd").version
except DistributionNotFound:
version = "2.0.0"
pass
6 changes: 0 additions & 6 deletions tests/e2e/online_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ def _get_datasource(self, server_file):
arguments = [command, server_file]
_test_command(arguments)

def _get_datasource(self, server_file):
command = "get"
server_file = "/datasources/" + server_file
arguments = [command, server_file]
_test_command(arguments)

def _create_extract(self, wb_name):
command = "createextracts"
arguments = [command, "-w", wb_name, "--encrypt"]
Expand Down

0 comments on commit 00df016

Please sign in to comment.