Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Project - Tarifs Crawler & API
crawler
Commits
236ab152
Commit
236ab152
authored
Jun 19, 2025
by
Marco Schmiedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
beb8700e
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
49 additions
and
102 deletions
+49
-102
01509001-bd4e-4462-93ad-dc5066fd729a.json
.sidekick/database/01509001-bd4e-4462-93ad-dc5066fd729a.json
+3
-3
0c371de0-5973-4ab4-928c-cf5415012cc8.json
.sidekick/database/0c371de0-5973-4ab4-928c-cf5415012cc8.json
+4
-4
36e791b4-e235-42f6-ac61-8560f1762892.json
.sidekick/database/36e791b4-e235-42f6-ac61-8560f1762892.json
+3
-3
38b9eebe-955e-4052-a0f6-29c69b1242b3.json
.sidekick/database/38b9eebe-955e-4052-a0f6-29c69b1242b3.json
+4
-4
5f874bee-40e2-4b9a-b102-f0b6d643a840.json
.sidekick/database/5f874bee-40e2-4b9a-b102-f0b6d643a840.json
+3
-3
e146d34c-9d63-4ea0-b8b8-5f8d503f34f6.json
.sidekick/database/e146d34c-9d63-4ea0-b8b8-5f8d503f34f6.json
+3
-3
fachhandel.xlsx
cache/fachhandel.xlsx
+0
-0
fachhandel2.xlsx
cache/fachhandel2.xlsx
+0
-0
fachhandel3.xlsx
cache/fachhandel3.xlsx
+0
-0
downloadDataFromMaui.py
commands/downloadDataFromMaui.py
+2
-2
setStaticOptionPrices.py
commands/setStaticOptionPrices.py
+27
-23
deal_deal.py
models/deal_deal.py
+0
-9
option_opti.py
models/option_opti.py
+0
-9
provisiongroup_pgro.py
models/provisiongroup_pgro.py
+0
-39
Workbench.mwb
workbench/Workbench.mwb
+0
-0
No files found.
.sidekick/database/01509001-bd4e-4462-93ad-dc5066fd729a.json
View file @
236ab152
...
...
@@ -2,11 +2,11 @@
"fileId"
:
"01509001-bd4e-4462-93ad-dc5066fd729a"
,
"originalPath"
:
"work/models/deal_deal.py"
,
"currentPath"
:
"work/models/deal_deal.py"
,
"hash"
:
"
f98ec3d5e7fa72f4907d6079628bf18a610e5229aca15ea7bfdca1008370f090
"
,
"hash"
:
"
40213041f5335d16b58dfc6a335038f521462e1985a09402f11c9b7c7fcdc031
"
,
"docContent"
:
"<p><br></p>"
,
"checkedStatus"
:
"done"
,
"comments"
:
[],
"lastCheckedTimestamp"
:
17
4669406966
7
,
"lastFileModificationTimestamp"
:
17
46694022329.5034
,
"lastCheckedTimestamp"
:
17
5032359119
7
,
"lastFileModificationTimestamp"
:
17
50322900297.3425
,
"flaggedForCopy"
:
false
}
.sidekick/database/0c371de0-5973-4ab4-928c-cf5415012cc8.json
View file @
236ab152
...
...
@@ -2,10 +2,10 @@
"fileId"
:
"0c371de0-5973-4ab4-928c-cf5415012cc8"
,
"originalPath"
:
"work/commands/setStaticOptionPrices.py"
,
"currentPath"
:
"work/commands/setStaticOptionPrices.py"
,
"hash"
:
"
ff9c898694ab65f87e613dcac0ab20c4565335db25c2656bed573d103ad2c694
"
,
"hash"
:
"
e6128d9a59cf3b14986ec7a96cf891e67dd77e7b50029fe6321f7625b32bd0b7
"
,
"docContent"
:
"<p><br></p>"
,
"checkedStatus"
:
"
todo
"
,
"checkedStatus"
:
"
done
"
,
"comments"
:
[],
"lastCheckedTimestamp"
:
17
49816832953
,
"lastFileModificationTimestamp"
:
17
49816769839.5076
"lastCheckedTimestamp"
:
17
50323678836
,
"lastFileModificationTimestamp"
:
17
50323672008.4895
}
.sidekick/database/36e791b4-e235-42f6-ac61-8560f1762892.json
View file @
236ab152
...
...
@@ -2,7 +2,7 @@
"fileId"
:
"36e791b4-e235-42f6-ac61-8560f1762892"
,
"originalPath"
:
"work/workbench/Workbench.mwb"
,
"currentPath"
:
"work/workbench/Workbench.mwb"
,
"hash"
:
"
afea3df7165b4dad78d5a9d92ede4fec601f68ed0a14147532cf1ca00617c29e
"
,
"hash"
:
"
66d7321a70d23c6704bde73d00b3102358f5942df6617b1c1f83a0d1e56d322b
"
,
"docContent"
:
"<p><br></p>"
,
"checkedStatus"
:
"done"
,
"comments"
:
[
...
...
@@ -12,6 +12,6 @@
"timestamp"
:
1746693753181
}
],
"lastCheckedTimestamp"
:
17
47070021483
,
"lastFileModificationTimestamp"
:
17
47068819870.2563
"lastCheckedTimestamp"
:
17
50328592721
,
"lastFileModificationTimestamp"
:
17
50322693600.0522
}
.sidekick/database/38b9eebe-955e-4052-a0f6-29c69b1242b3.json
View file @
236ab152
...
...
@@ -2,9 +2,9 @@
"fileId"
:
"38b9eebe-955e-4052-a0f6-29c69b1242b3"
,
"originalPath"
:
"work/config/MysqlConfig.py"
,
"currentPath"
:
"work/config/MysqlConfig.py"
,
"hash"
:
"
d8958dba0bf7c100587dabf6ff576e0a1905a0aed4980a6c64ff6254f3671e5a
"
,
"hash"
:
"
a6de5ed4cb42c8208047b4466357bde2952886430465dbff6097f02d8e886d7c
"
,
"docContent"
:
"<p><br></p>"
,
"checkedStatus"
:
"
changed
"
,
"checkedStatus"
:
"
todo
"
,
"comments"
:
[
{
"commentId"
:
"56c5adba-20f4-4524-a894-41f81ab7ca55"
,
...
...
@@ -12,6 +12,6 @@
"timestamp"
:
1744622354948
}
],
"lastCheckedTimestamp"
:
17
47123619645
,
"lastFileModificationTimestamp"
:
17
49816529644.1785
"lastCheckedTimestamp"
:
17
50328615978
,
"lastFileModificationTimestamp"
:
17
50328609835.271
}
.sidekick/database/5f874bee-40e2-4b9a-b102-f0b6d643a840.json
View file @
236ab152
...
...
@@ -2,10 +2,10 @@
"fileId"
:
"5f874bee-40e2-4b9a-b102-f0b6d643a840"
,
"originalPath"
:
"work/commands/downloadDataFromMaui.py"
,
"currentPath"
:
"work/commands/downloadDataFromMaui.py"
,
"hash"
:
"
f75e0013a123055434a4592bb3509d3ff298273727226ef431662f3fad739fad
"
,
"hash"
:
"
7bf05e24539e6b6cc9b9abf1c3103aee2e4419c1dd5c2a8fadd2d825947b951f
"
,
"docContent"
:
"<p><br></p>"
,
"checkedStatus"
:
"done"
,
"comments"
:
[],
"lastCheckedTimestamp"
:
17
47071242419
,
"lastFileModificationTimestamp"
:
17
47071185164.952
"lastCheckedTimestamp"
:
17
50323681845
,
"lastFileModificationTimestamp"
:
17
50323366660.076
}
.sidekick/database/e146d34c-9d63-4ea0-b8b8-5f8d503f34f6.json
View file @
236ab152
...
...
@@ -2,11 +2,11 @@
"fileId"
:
"e146d34c-9d63-4ea0-b8b8-5f8d503f34f6"
,
"originalPath"
:
"work/models/option_opti.py"
,
"currentPath"
:
"work/models/option_opti.py"
,
"hash"
:
"
389c9070a2271f186f35fac6f51490b3ec7b5a4483b0769af7309b36aac0a163
"
,
"hash"
:
"
af00a2687f2ac9ea0285e96ec70320ea2a3bf3ed4359b2850b1b1273c236e7ce
"
,
"docContent"
:
"<p><br></p>"
,
"checkedStatus"
:
"done"
,
"comments"
:
[],
"lastCheckedTimestamp"
:
17
46694066635
,
"lastFileModificationTimestamp"
:
17
46694007962.1345
,
"lastCheckedTimestamp"
:
17
50323587708
,
"lastFileModificationTimestamp"
:
17
50322895612.6667
,
"flaggedForCopy"
:
false
}
cache/fachhandel.xlsx
deleted
100644 → 0
View file @
beb8700e
File deleted
cache/fachhandel2.xlsx
deleted
100644 → 0
View file @
beb8700e
File deleted
cache/fachhandel3.xlsx
deleted
100644 → 0
View file @
beb8700e
File deleted
commands/downloadDataFromMaui.py
View file @
236ab152
...
...
@@ -261,8 +261,8 @@ def scrapeData(seleniumManager):
# This variable holds the Selenium driver instance.
seleniumDriver
=
seleniumManager
.
driver
# This variable is a WebDriverWait object with a
2
0-second timeout.
wait
=
WebDriverWait
(
seleniumDriver
,
2
0
)
# This variable is a WebDriverWait object with a
6
0-second timeout.
wait
=
WebDriverWait
(
seleniumDriver
,
6
0
)
# This variable defines the path for the cache directory.
cacheDir
=
"../cache"
...
...
commands/setStaticOptionPrices.py
View file @
236ab152
...
...
@@ -4,21 +4,22 @@ import logging
from
sqlalchemy
import
text
from
manager.MysqlManager
import
MysqlManager
# Logging
-Konfiguration wie in deiner Vorlage für klare Statusmeldungen
.
# Logging
configuration as in your template for clear status messages
.
logging
.
basicConfig
(
level
=
logging
.
INFO
,
format
=
"
%(asctime)
s
%(levelname)
s:
%(message)
s"
)
# List
e aller statischen SQL-Update-Befehle, die ausgeführt werden sollen
.
#
Die Bedingung "and provision1_opti = 0" stellt sicher, dass jeder Befehl
#
nur einmal erfolgreich ausgeführt wird
.
# List
of all static SQL update commands to be executed
.
#
The condition "and provision1_opti = 0" ensures that each command
#
is executed successfully only once
.
sql_updates
=
[
# Kategorie 1: Rabatte auf den Anschlusspreis
# Category 1: Discounts on the connection fee
'update option_opti set provision1_opti = -8 where providercode_opti = "O3150922" and provision1_opti = 0;'
,
'update option_opti set provision1_opti = -33.61 where providercode_opti = "O3150921" and provision1_opti = 0;'
,
#
Kategorie 2: Aktionsguthaben
#
Category 2: Promotional credit
'update option_opti set provision1_opti = -20.17 where providercode_opti = "O3120740" and provision1_opti = 0;'
,
'update option_opti set provision1_opti = -20.17 where providercode_opti = "O3120741" and provision1_opti = 0;'
,
'update option_opti set provision1_opti = -40.34 where providercode_opti = "O3120743" and provision1_opti = 0;'
,
...
...
@@ -42,7 +43,7 @@ sql_updates = [
'update option_opti set provision1_opti = -201.68 where providercode_opti = "O3120759" and provision1_opti = 0;'
,
'update option_opti set provision1_opti = -201.68 where providercode_opti = "O3120760" and provision1_opti = 0;'
,
#
Kategorie 3: Tarif-Rabatte
#
Category 3: Tariff discounts
'UPDATE option_opti SET provision1_opti = -20 WHERE providercode_opti = "O3357017" AND provision1_opti = 0;'
,
'UPDATE option_opti SET provision1_opti = -40 WHERE providercode_opti = "O3357018" AND provision1_opti = 0;'
,
'UPDATE option_opti SET provision1_opti = -40 WHERE providercode_opti = "O3708586" AND provision1_opti = 0;'
,
...
...
@@ -64,7 +65,7 @@ sql_updates = [
'UPDATE option_opti SET provision1_opti = -240 WHERE providercode_opti = "O3708574" AND provision1_opti = 0;'
,
'UPDATE option_opti SET provision1_opti = -240 WHERE providercode_opti = "O3708544" AND provision1_opti = 0;'
,
#
Kategorie
4: Cashback
#
Category
4: Cashback
'UPDATE option_opti SET provision1_opti = -35 WHERE providercode_opti = "O3501314" AND provision1_opti = 0;'
,
'UPDATE option_opti SET provision1_opti = -45 WHERE providercode_opti = "O3501311" AND provision1_opti = 0;'
,
'UPDATE option_opti SET provision1_opti = -75 WHERE providercode_opti = "O3501308" AND provision1_opti = 0;'
,
...
...
@@ -72,39 +73,42 @@ sql_updates = [
]
#
Die Variable “mysql” stellt die Verbindung zur Datenbank her
.
#
The "mysql" variable establishes the connection to the database
.
mysql
=
MysqlManager
()
#
Die Variable “session” holt die SQLAlchemy-Session für alle Datenbankoperationen
.
#
The "session" variable retrieves the SQLAlchemy session for all database operations
.
session
=
mysql
.
getSession
()
logging
.
info
(
"Start
e statische Provisions-U
pdates..."
)
logging
.
info
(
"Start
ing static provision u
pdates..."
)
updated_count
=
0
total_count
=
len
(
sql_updates
)
try
:
#
Schleife durch alle SQL-Befehle und führe sie einzeln aus
.
#
Loop through all SQL commands and execute them one by one
.
for
i
,
query
in
enumerate
(
sql_updates
):
# session.execute() mit text() ist der Standardweg, um Raw SQL sicher auszuführen.
# session.execute() with text() is the standard way to safely execute raw SQL.
result
=
session
.
execute
(
text
(
query
))
# result.rowcount
gibt an, wie viele Zeilen vom UPDATE betroffen waren
.
#
Dies ist nützlich für das Logging, um zu sehen, ob eine Änderung stattgefunden hat
.
# result.rowcount
indicates how many rows were affected by the UPDATE
.
#
This is useful for logging to see if a change has occurred
.
if
result
.
rowcount
>
0
:
updated_count
+=
result
.
rowcount
logging
.
info
(
f
"Query {i+1}/{total_count}: {result.rowcount}
Zeile(n) aktualisiert
."
)
logging
.
info
(
f
"Query {i+1}/{total_count}: {result.rowcount}
row(s) updated
."
)
#
Wenn alle Befehle ohne Fehler durchgelaufen sind, werden die Änderungen
committed.
#
If all commands have run without error, the changes are
committed.
session
.
commit
()
logging
.
info
(
f
"All
e {total_count} Updates erfolgreich verarbeitet. Insgesamt wurden {updated_count} Zeilen geändert
."
)
logging
.
info
(
f
"All
{total_count} updates processed successfully. A total of {updated_count} rows were changed
."
)
except
Exception
as
e
:
# Bei einem Fehler wird die gesamte Transaktion zurückgerollt, um inkonsistente Daten zu vermeiden.
logging
.
error
(
f
"Ein Fehler ist aufgetreten: {e}"
)
logging
.
error
(
"Die Transaktion wird zurückgerollt (Rollback)."
)
# In case of an error, the entire transaction is rolled back to avoid inconsistent data.
logging
.
error
(
f
"An error occurred: {e}"
)
logging
.
error
(
"The transaction is being rolled back."
)
session
.
rollback
()
finally
:
# Die Session wird in jedem Fall geschlossen, um die Verbindung freizugeben.
# The session is closed in any case to release the connection.
session
.
close
()
logging
.
info
(
"Datenbank-Session geschlossen."
)
\ No newline at end of file
logging
.
info
(
"Database session closed."
)
\ No newline at end of file
models/deal_deal.py
View file @
236ab152
from
sqlalchemy
import
Column
,
Integer
,
String
,
Numeric
,
DateTime
,
ForeignKey
from
sqlalchemy.orm
import
relationship
from
models._system
import
Base
from
models.provisiongroup_pgro
import
ProvisiongroupPgro
class
DealDeal
(
Base
):
...
...
@@ -13,10 +12,6 @@ class DealDeal(Base):
primary_key
=
True
,
autoincrement
=
True
)
provisiongroup_deal
=
Column
(
Integer
,
ForeignKey
(
'provisiongroup_pgro.id_pgro'
)
)
base_deal
=
Column
(
Integer
,
ForeignKey
(
'base_base.id_base'
),
...
...
@@ -75,7 +70,3 @@ class DealDeal(Base):
"BaseBase"
,
back_populates
=
"deals"
)
provisiongroup
=
relationship
(
"ProvisiongroupPgro"
,
back_populates
=
"deals"
)
models/option_opti.py
View file @
236ab152
from
sqlalchemy
import
Column
,
Integer
,
String
,
Numeric
,
DateTime
,
ForeignKey
from
sqlalchemy.orm
import
relationship
from
models._system
import
Base
from
models.provisiongroup_pgro
import
ProvisiongroupPgro
class
OptionOpti
(
Base
):
...
...
@@ -13,10 +12,6 @@ class OptionOpti(Base):
primary_key
=
True
,
autoincrement
=
True
)
provisiongroup_opti
=
Column
(
Integer
,
ForeignKey
(
'provisiongroup_pgro.id_pgro'
)
)
base_opti
=
Column
(
Integer
,
ForeignKey
(
'base_base.id_base'
),
...
...
@@ -79,7 +74,3 @@ class OptionOpti(Base):
"BaseBase"
,
back_populates
=
"options"
)
provisiongroup
=
relationship
(
"ProvisiongroupPgro"
,
back_populates
=
"options"
)
models/provisiongroup_pgro.py
deleted
100644 → 0
View file @
beb8700e
from
sqlalchemy
import
Column
,
Integer
,
String
,
Numeric
,
DateTime
from
sqlalchemy.orm
import
relationship
from
models._system
import
Base
class
ProvisiongroupPgro
(
Base
):
__tablename__
=
'provisiongroup_pgro'
id_pgro
=
Column
(
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
name_pgro
=
Column
(
String
(
255
),
nullable
=
False
)
percent_pgro
=
Column
(
Numeric
(
5
,
2
),
nullable
=
False
,
default
=
0.00
)
created_pgro
=
Column
(
DateTime
,
nullable
=
False
)
updated_pgro
=
Column
(
DateTime
,
nullable
=
True
)
deals
=
relationship
(
"DealDeal"
,
back_populates
=
"provisiongroup"
)
options
=
relationship
(
"OptionOpti"
,
back_populates
=
"provisiongroup"
)
workbench/Workbench.mwb
View file @
236ab152
No preview for this file type
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