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
b0509920
Valider
b0509920
rédigé
13 sept. 2020
par
Tulir Asokan
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Add support for ordering stickers in custom packs
parent
727b022b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
README.md
+2
-0
2 ajouts, 0 suppression
README.md
sticker/pack.py
+7
-1
7 ajouts, 1 suppression
sticker/pack.py
avec
9 ajouts
et
1 suppression
README.md
+
2
−
0
Voir le fichier @
b0509920
...
...
@@ -36,6 +36,8 @@ Notes:
1.
Create a directory with your sticker images.
*
The file name (excluding extension) will be used as the caption.
*
The directory name will be used as the pack name/ID.
*
If you want the stickers to appear in a specific order, prefix them with
`<number>-`
,
e.g.
`01-Cat.png`
. The number and dash won't be included in the caption.
2.
Run
`sticker-pack <pack directory>`
.
*
If you want to override the pack displayname, pass
`--title <custom title>`
.
3.
Copy
`<pack directory>/pack.json`
to
`web/packs/your-pack-name.json`
.
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
sticker/pack.py
+
7
−
1
Voir le fichier @
b0509920
...
...
@@ -42,7 +42,7 @@ async def main(args: argparse.Namespace) -> None:
else
:
old_stickers
=
{
sticker
[
"
id
"
]:
sticker
for
sticker
in
pack
[
"
stickers
"
]}
pack
[
"
stickers
"
]
=
[]
for
file
in
os
.
listdir
(
args
.
path
):
for
file
in
sorted
(
os
.
listdir
(
args
.
path
)
)
:
if
file
.
startswith
(
"
.
"
):
continue
path
=
os
.
path
.
join
(
args
.
path
,
file
)
...
...
@@ -60,6 +60,12 @@ async def main(args: argparse.Namespace) -> None:
continue
print
(
f
"
Processing
{
file
}
"
,
end
=
""
,
flush
=
True
)
name
=
os
.
path
.
splitext
(
file
)[
0
]
# If the name starts with "number-", remove the prefix
name_split
=
name
.
split
(
"
-
"
,
1
)
if
len
(
name_split
)
==
2
and
name_split
[
0
].
isdecimal
():
name
=
name_split
[
1
]
sticker_id
=
f
"
sha256:
{
sha256
(
image_data
).
hexdigest
()
}
"
print
(
"
.
"
,
end
=
""
,
flush
=
True
)
if
sticker_id
in
old_stickers
:
...
...
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
Please
se connecter
to comment