Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
stickerpicker
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
stickerpicker
Validations
c106c99b
Valider
c106c99b
rédigé
Il y a 4 ans
par
Tulir Asokan
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Maybe make import.py work on Python 3.6
parent
5e3fc57b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
import.py
+15
-14
15 ajouts, 14 suppressions
import.py
avec
15 ajouts
et
14 suppressions
import.py
+
15
−
14
Voir le fichier @
c106c99b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from
typing
import
Dict
,
TypedDict
,
Optional
from
typing
import
Dict
,
Optional
,
TYPE_CHECKING
from
io
import
BytesIO
from
io
import
BytesIO
import
argparse
import
argparse
import
os.path
import
os.path
...
@@ -70,6 +70,7 @@ async def upload(data: bytes, mimetype: str, filename: str) -> str:
...
@@ -70,6 +70,7 @@ async def upload(data: bytes, mimetype: str, filename: str) -> str:
return
(
await
resp
.
json
())[
"
content_uri
"
]
return
(
await
resp
.
json
())[
"
content_uri
"
]
if
TYPE_CHECKING
:
class
MatrixMediaInfo
(
TypedDict
):
class
MatrixMediaInfo
(
TypedDict
):
w
:
int
w
:
int
h
:
int
h
:
int
...
@@ -93,7 +94,7 @@ def convert_image(data: bytes) -> (bytes, int, int):
...
@@ -93,7 +94,7 @@ def convert_image(data: bytes) -> (bytes, int, int):
return
new_file
.
getvalue
(),
w
,
h
return
new_file
.
getvalue
(),
w
,
h
async
def
reupload_document
(
client
:
TelegramClient
,
document
:
Document
)
->
MatrixStickerInfo
:
async
def
reupload_document
(
client
:
TelegramClient
,
document
:
Document
)
->
'
MatrixStickerInfo
'
:
print
(
f
"
Reuploading
{
document
.
id
}
"
,
end
=
""
,
flush
=
True
)
print
(
f
"
Reuploading
{
document
.
id
}
"
,
end
=
""
,
flush
=
True
)
data
=
await
client
.
download_media
(
document
,
file
=
bytes
)
data
=
await
client
.
download_media
(
document
,
file
=
bytes
)
print
(
"
.
"
,
end
=
""
,
flush
=
True
)
print
(
"
.
"
,
end
=
""
,
flush
=
True
)
...
@@ -168,7 +169,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull) -> None:
...
@@ -168,7 +169,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull) -> None:
except
FileNotFoundError
:
except
FileNotFoundError
:
pass
pass
reuploaded_documents
:
Dict
[
int
,
MatrixStickerInfo
]
=
{}
reuploaded_documents
:
Dict
[
int
,
'
MatrixStickerInfo
'
]
=
{}
for
document
in
pack
.
documents
:
for
document
in
pack
.
documents
:
try
:
try
:
reuploaded_documents
[
document
.
id
]
=
already_uploaded
[
document
.
id
]
reuploaded_documents
[
document
.
id
]
=
already_uploaded
[
document
.
id
]
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter