Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
scrapper-portabilidad
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier
scrapper-portabilidad
Commits
71216407
Commit
71216407
authored
Apr 28, 2022
by
Javier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Errata
parent
caf4ba71
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
cli.py
cli.py
+10
-10
No files found.
cli.py
View file @
71216407
...
@@ -170,7 +170,7 @@ def update_balance(target_clis: list[str]) -> Tuple[int, int]:
...
@@ -170,7 +170,7 @@ def update_balance(target_clis: list[str]) -> Tuple[int, int]:
def
add_cdrs
(
accounts
:
list
[
dict
])
->
'list[dict]'
:
def
add_cdrs
(
accounts
:
list
[
dict
])
->
'list[dict]'
:
cdrs
=
[]
cdrs
=
[]
for
account
in
(
accounts
.
keys
()):
for
account
in
(
accounts
.
keys
()):
cdrs
.
extend
(
get_cdrs
(
phone_number
=
account
,
since
=
accounts
[
account
]))
cdrs
.
extend
(
get_cdrs
(
phone_number
=
account
,
since
=
accounts
[
account
]))
with
typer
.
progressbar
(
cdrs
,
label
=
'Sincronizando CDRs'
)
as
cdr_data
:
with
typer
.
progressbar
(
cdrs
,
label
=
'Sincronizando CDRs'
)
as
cdr_data
:
with
pyodbc
.
connect
(
SQL_SERVER_CNX_STRING
)
as
cnx
:
with
pyodbc
.
connect
(
SQL_SERVER_CNX_STRING
)
as
cnx
:
...
@@ -192,7 +192,7 @@ def add_cdrs(accounts: list[dict]) -> 'list[dict]':
...
@@ -192,7 +192,7 @@ def add_cdrs(accounts: list[dict]) -> 'list[dict]':
return
cdrs
return
cdrs
def
process_refills
()
->
Tuple
[
int
,
float
]:
def
process_refills
()
->
Tuple
[
int
,
float
]:
"""Ejecuta las Recargas pendientes
"""Ejecuta las Recargas pendientes
"""
"""
...
@@ -316,21 +316,21 @@ def synchronize():
...
@@ -316,21 +316,21 @@ def synchronize():
new_plataform_activate
(
*
fully_ported_clis
())
new_plataform_activate
(
*
fully_ported_clis
())
typer
.
echo
(
'Verificación de Plataformas Finalizada'
)
typer
.
echo
(
'Verificación de Plataformas Finalizada'
)
# Actualización de Estado
updated
,
non_updated
=
update_balance
(
update_target_clis
())
msg
=
"Se han actualizado "
msg
=
msg
+
typer
.
style
(
updated
,
fg
=
typer
.
colors
.
GREEN
,
bold
=
True
)
msg
=
msg
+
f
" de un total de {updated + non_updated} líneas."
typer
.
echo
(
msg
)
# Recargas
# Recargas
total_refills
,
amount
=
process_refills
()
total_refills
,
amount
=
process_refills
()
msg
=
f
"Se han procesado "
msg
=
f
"Se han procesado "
msg
=
msg
+
typer
.
style
(
total_refills
,
fg
=
typer
.
colors
.
GREEN
,
bold
=
True
)
msg
=
msg
+
typer
.
style
(
total_refills
,
fg
=
typer
.
colors
.
GREEN
,
bold
=
True
)
e
msg
=
msg
+
" recargas con un importe total de "
msg
=
msg
+
" recargas con un importe total de "
msg
=
msg
+
typer
.
style
(
f
'{amount}€'
,
fg
=
typer
.
colors
.
GREEN
,
bold
=
True
)
msg
=
msg
+
typer
.
style
(
f
'{amount}€'
,
fg
=
typer
.
colors
.
GREEN
,
bold
=
True
)
typer
.
echo
(
msg
)
typer
.
echo
(
msg
)
# Actualización de Estado
updated
,
non_updated
=
update_balance
(
update_target_clis
())
msg
=
"Se han actualizado "
msg
=
msg
+
typer
.
style
(
updated
,
fg
=
typer
.
colors
.
GREEN
,
bold
=
True
)
msg
=
msg
+
f
" de un total de {updated + non_updated} líneas."
typer
.
echo
(
msg
)
# Actualización de CDRs
# Actualización de CDRs
accounts
=
get_last_updated_cdr
()
accounts
=
get_last_updated_cdr
()
cdrs
=
add_cdrs
(
accounts
)
cdrs
=
add_cdrs
(
accounts
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment