csc-cia-stne 0.1.17__tar.gz → 0.1.19__tar.gz
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.
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/PKG-INFO +1 -1
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/pyproject.toml +1 -1
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/ftp.py +26 -7
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne.egg-info/PKG-INFO +1 -1
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/LICENCE +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/README.md +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/README_PYPI.md +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/setup.cfg +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/__init__.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/bc_correios.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/bc_sta.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/email.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/gcp_bigquery.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/gcp_bucket.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/google_drive.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/karavela.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/logger_json.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/logger_rich.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/provio.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/servicenow.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/slack.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/stne_admin.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/__init__.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/__init__.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_b64.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_converters.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_datetime.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_delete.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_get_secret.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_recriar_pastas.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_settings.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_titulo.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_validate_json.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/GcpBigQueryValidator.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/GoogleDriveValidator.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/ServiceNowValidator.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/__init__.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/ftp.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/gcp_bucket.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/waccess.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/web_validator.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/web_screen/__init__.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/web_screen/web_screen_abstract.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/web_screen/web_screen_botcity.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/web_screen/web_screen_selenium.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/wacess.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/web.py +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne.egg-info/SOURCES.txt +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne.egg-info/dependency_links.txt +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne.egg-info/requires.txt +0 -0
- {csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "csc_cia_stne"
|
7
|
-
version = "0.1.
|
7
|
+
version = "0.1.19"
|
8
8
|
license = { text = "MIT" }
|
9
9
|
description = "Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs"
|
10
10
|
keywords = ["karavela", "csc", "cia", "stone", "rpa", "botcity", "stne"]
|
@@ -8,7 +8,7 @@ from .utilitarios.validations.ftp import InitParamsValidator,UploadDownloadValid
|
|
8
8
|
|
9
9
|
class FTP():
|
10
10
|
|
11
|
-
def __init__(self, host:str , user:str , password:str , timeout:int=30, port:
|
11
|
+
def __init__(self, host:str , user:str , password:str , timeout:int=30, port:int=21, tls:bool=True, ssl:bool=True, verify_ssl:bool=False, verify_host:bool=False, tryouts:int=3, sftp:bool=False, ssh_password:bool=False):
|
12
12
|
|
13
13
|
self.host = host
|
14
14
|
self.user = user
|
@@ -20,6 +20,8 @@ class FTP():
|
|
20
20
|
self.verify_ssl = verify_ssl
|
21
21
|
self.verify_host = verify_host
|
22
22
|
self.tryouts = tryouts
|
23
|
+
self.sftp = sftp
|
24
|
+
self.ssh_password = ssh_password
|
23
25
|
|
24
26
|
try:
|
25
27
|
|
@@ -92,7 +94,11 @@ class FTP():
|
|
92
94
|
|
93
95
|
connection_ftp = pycurl.Curl()
|
94
96
|
|
95
|
-
connection_ftp.setopt(connection_ftp.USERPWD, f"{self.user}:{self.password}")
|
97
|
+
connection_ftp.setopt(connection_ftp.USERPWD, f"{self.user}:{self.password}".encode("utf-8"))
|
98
|
+
|
99
|
+
if self.ssh_password:
|
100
|
+
|
101
|
+
connection_ftp.setopt(connection_ftp.SSH_AUTH_TYPES, connection_ftp.SSH_AUTH_PASSWORD)
|
96
102
|
|
97
103
|
connection_ftp.setopt(connection_ftp.CONNECTTIMEOUT, self.timeout) # Tempo limite para conexão
|
98
104
|
|
@@ -156,13 +162,20 @@ class FTP():
|
|
156
162
|
|
157
163
|
raise ValueError(f"Erro na validação dos parâmetros de upload/download: {str(e)}")
|
158
164
|
|
159
|
-
|
165
|
+
|
166
|
+
local_path = os.path.join(os.getcwd(), filename)
|
160
167
|
|
161
168
|
connection_ftp = self._login_server()
|
162
169
|
|
163
|
-
remote_path = f"{filepathftp}{filename}"
|
170
|
+
remote_path = f"{filepathftp}{filename.split('/')[-1]}"
|
164
171
|
|
165
|
-
|
172
|
+
if self.sftp:
|
173
|
+
|
174
|
+
ftp_url = f"sftp://{self.host}:{self.port}{remote_path}"
|
175
|
+
|
176
|
+
else:
|
177
|
+
|
178
|
+
ftp_url = f"ftp://{self.host}:{self.port}{remote_path}"
|
166
179
|
|
167
180
|
status_upload = True
|
168
181
|
|
@@ -178,7 +191,7 @@ class FTP():
|
|
178
191
|
|
179
192
|
try:
|
180
193
|
|
181
|
-
with open(
|
194
|
+
with open(local_path, methodfile) as file:
|
182
195
|
|
183
196
|
connection_ftp.setopt(connection_ftp.URL, ftp_url)
|
184
197
|
|
@@ -262,7 +275,13 @@ class FTP():
|
|
262
275
|
|
263
276
|
connection_ftp = self._login_server()
|
264
277
|
|
265
|
-
|
278
|
+
if self.sftp:
|
279
|
+
|
280
|
+
ftp_url = f"sftp://{self.host}:{port}{remote_path}"
|
281
|
+
|
282
|
+
else:
|
283
|
+
|
284
|
+
ftp_url = f"ftp://{self.host}:{port}{remote_path}"
|
266
285
|
|
267
286
|
for try_out in range(self.tryouts):
|
268
287
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/__init__.py
RENAMED
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_b64.py
RENAMED
File without changes
|
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_datetime.py
RENAMED
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_delete.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_settings.py
RENAMED
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/functions/func_titulo.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/__init__.py
RENAMED
File without changes
|
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/gcp_bucket.py
RENAMED
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/validations/waccess.py
RENAMED
File without changes
|
File without changes
|
{csc_cia_stne-0.1.17 → csc_cia_stne-0.1.19}/src/csc_cia_stne/utilitarios/web_screen/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|