Skip to content

Commit feb196d

Browse files
committed
rel 2022.1.1
1 parent 92040f0 commit feb196d

File tree

12 files changed

+192
-108
lines changed

12 files changed

+192
-108
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
All major and minor version changes will be documented in this file. Details of
44
patch-level version changes can be found in [commit messages](../../commits/master).
55

6+
## 2022.1.1 - 2022/06/25
7+
8+
- Fix: use `os.makedirs` instead of `os.mkdir`
9+
- Update pre-commit
10+
611
## 2022.1 - 2022/04/11
712

813
- Tests and code improvements

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![PyPI Total Downloads](https://img.shields.io/badge/dynamic/json?style=for-the-badge&label=total%20downloads&query=%24.total_downloads&url=https%3A%2F%2Fapi.pepy.tech%2Fapi%2Fprojects%2Fsigstickers)](https://pepy.tech/project/sigstickers)
99
[![PyPI Version](https://img.shields.io/pypi/v/sigstickers.svg?style=for-the-badge)](https://pypi.org/project/sigstickers)
1010

11-
<!-- omit in TOC -->
11+
<!-- omit in toc -->
1212
# SigStickers - Signal Sticker Downloader
1313

1414
<img src="readme-assets/icons/name.png" alt="Project Icon" width="750">
@@ -34,6 +34,8 @@ Download sticker packs from Signal
3434
- [How to run](#how-to-run)
3535
- [Windows](#windows)
3636
- [Linux/ MacOS](#linux-macos)
37+
- [Building](#building)
38+
- [Testing](#testing)
3739
- [Download Project](#download-project)
3840
- [Clone](#clone)
3941
- [Using The Command Line](#using-the-command-line)
@@ -108,8 +110,8 @@ Head to https://pypi.org/project/sigstickers/ for more info
108110
109111
### Built for
110112
111-
This program has been written for Python versions 3.7 - 3.10 and has been tested with both 3.7 and
112-
3.10
113+
This program has been written for Python versions 3.8 - 3.11 and has been tested with both 3.8 and
114+
3.11
113115
114116
## Install Python on Windows
115117
@@ -169,6 +171,36 @@ version.
169171
- File
170172
`python3.x [file]` or `./[file]`
171173
174+
## Building
175+
176+
This project uses https://github.com/FHPythonUtils/FHMake to automate most of the building. This
177+
command generates the documentation, updates the requirements.txt and builds the library artefacts
178+
179+
Note the functionality provided by fhmake can be approximated by the following
180+
181+
```sh
182+
handsdown --cleanup -o documentation/reference
183+
poetry export -f requirements.txt --output requirements.txt
184+
poetry export -f requirements.txt --with dev --output requirements_optional.txt
185+
poetry build
186+
```
187+
188+
`fhmake audit` can be run to perform additional checks
189+
190+
## Testing
191+
192+
For testing with the version of python used by poetry use
193+
194+
```sh
195+
poetry run pytest
196+
```
197+
198+
Alternatively use `tox` to run tests over python 3.8 - 3.11
199+
200+
```sh
201+
tox
202+
```
203+
172204
## Download Project
173205
174206
### Clone

documentation/reference/MODULES.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

documentation/reference/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Sigstickers Modules
1+
# Sigstickers Index
22

3-
> Auto-generated documentation modules index.
3+
> Auto-generated documentation index.
44
5-
Full list of [Sigstickers](README.md#sigstickers-index) project modules.
5+
A full list of `Sigstickers` project modules.
66

7-
- [Sigstickers Index](README.md#sigstickers-index)
87
- [Sigstickers](sigstickers/index.md#sigstickers)
98
- [Module](sigstickers/module.md#module)
109
- [Caching](sigstickers/caching.md#caching)
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# Caching
22

3-
> Auto-generated documentation for [sigstickers.caching](../../../sigstickers/caching.py) module.
3+
[Sigstickers Index](../README.md#sigstickers-index) /
4+
[Sigstickers](./index.md#sigstickers) /
5+
Caching
46

5-
Sticker caching functionality used by the downloader.
7+
> Auto-generated documentation for [sigstickers.caching](../../../sigstickers/caching.py) module.
68
7-
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / [Sigstickers](index.md#sigstickers) / Caching
8-
- [createConverted](#createconverted)
9-
- [verifyConverted](#verifyconverted)
9+
- [Caching](#caching)
10+
- [createConverted](#createconverted)
11+
- [verifyConverted](#verifyconverted)
1012

1113
## createConverted
1214

13-
[[find in source code]](../../../sigstickers/caching.py#L52)
14-
15-
```python
16-
def createConverted(packName: str, data: dict):
17-
```
15+
[Show source in caching.py:52](../../../sigstickers/caching.py#L52)
1816

1917
Write cache data to a file identified by packName
2018

@@ -23,14 +21,19 @@ Write cache data to a file identified by packName
2321
- `packName` *str* - name of the sticker pack eg. "DonutTheDog"
2422
- `data` *dict* - packName cache data to write to cache
2523

26-
## verifyConverted
27-
28-
[[find in source code]](../../../sigstickers/caching.py#L14)
24+
#### Signature
2925

3026
```python
31-
def verifyConverted(packName: str) -> bool:
27+
def createConverted(packName: str, data: dict):
28+
...
3229
```
3330

31+
32+
33+
## verifyConverted
34+
35+
[Show source in caching.py:14](../../../sigstickers/caching.py#L14)
36+
3437
Verify the cache for a packName eg. "DonutTheDog". Uses the cache "version"
3538
to call the verify function for that version
3639

@@ -41,3 +44,12 @@ to call the verify function for that version
4144
#### Returns
4245

4346
- `bool` - if the converted cache has been verified
47+
48+
#### Signature
49+
50+
```python
51+
def verifyConverted(packName: str) -> bool:
52+
...
53+
```
54+
55+
Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# Downloader
22

3-
> Auto-generated documentation for [sigstickers.downloader](../../../sigstickers/downloader.py) module.
3+
[Sigstickers Index](../README.md#sigstickers-index) /
4+
[Sigstickers](./index.md#sigstickers) /
5+
Downloader
46

5-
Sticker download and convert functions used by the module entry point.
7+
> Auto-generated documentation for [sigstickers.downloader](../../../sigstickers/downloader.py) module.
68
7-
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / [Sigstickers](index.md#sigstickers) / Downloader
8-
- [assureDirExists](#assuredirexists)
9-
- [convertPack](#convertpack)
10-
- [convertWithPIL](#convertwithpil)
11-
- [downloadPack](#downloadpack)
12-
- [saveSticker](#savesticker)
9+
- [Downloader](#downloader)
10+
- [assureDirExists](#assuredirexists)
11+
- [convertPack](#convertpack)
12+
- [convertWithPIL](#convertwithpil)
13+
- [downloadPack](#downloadpack)
14+
- [saveSticker](#savesticker)
1315

1416
## assureDirExists
1517

16-
[[find in source code]](../../../sigstickers/downloader.py#L19)
17-
18-
```python
19-
def assureDirExists(directory: str, root: str) -> str:
20-
```
18+
[Show source in downloader.py:19](../../../sigstickers/downloader.py#L19)
2119

2220
Make the dir if not exists
2321

@@ -30,14 +28,19 @@ Make the dir if not exists
3028

3129
- `str` - the full path
3230

33-
## convertPack
34-
35-
[[find in source code]](../../../sigstickers/downloader.py#L115)
31+
#### Signature
3632

3733
```python
38-
async def convertPack(swd: str, packName: str, noCache=False):
34+
def assureDirExists(directory: str, root: str) -> str:
35+
...
3936
```
4037

38+
39+
40+
## convertPack
41+
42+
[Show source in downloader.py:112](../../../sigstickers/downloader.py#L112)
43+
4144
Convert the webp images into png and gif images
4245

4346
#### Arguments
@@ -46,14 +49,19 @@ Convert the webp images into png and gif images
4649
- `packName` *str* - name of the sticker pack (for cache + logging)
4750
- `noCache` *bool, optional* - set to true to disable cache. Defaults to False.
4851

49-
## convertWithPIL
50-
51-
[[find in source code]](../../../sigstickers/downloader.py#L94)
52+
#### Signature
5253

5354
```python
54-
def convertWithPIL(inputFile: str) -> str:
55+
async def convertPack(swd: str, packName: str, noCache=False):
56+
...
5557
```
5658

59+
60+
61+
## convertWithPIL
62+
63+
[Show source in downloader.py:91](../../../sigstickers/downloader.py#L91)
64+
5765
Convert the webp file to png
5866

5967
#### Arguments
@@ -64,18 +72,19 @@ Convert the webp file to png
6472

6573
- `str` - path to input file
6674

67-
## downloadPack
68-
69-
[[find in source code]](../../../sigstickers/downloader.py#L57)
75+
#### Signature
7076

7177
```python
72-
async def downloadPack(
73-
packId: str,
74-
packKey: str,
75-
cwd: str = os.getcwd(),
76-
) -> tuple[str, str]:
78+
def convertWithPIL(inputFile: str) -> str:
79+
...
7780
```
7881

82+
83+
84+
## downloadPack
85+
86+
[Show source in downloader.py:54](../../../sigstickers/downloader.py#L54)
87+
7988
Download a sticker pack.
8089

8190
#### Arguments
@@ -89,14 +98,21 @@ c957a57000626a2dc3cb69bf0e79c91c6b196b74d4d6ca1cbb830d3ad0ad4e36
8998

9099
- `tuple[str,` *str]* - sticker working directory and pack title
91100

92-
## saveSticker
93-
94-
[[find in source code]](../../../sigstickers/downloader.py#L38)
101+
#### Signature
95102

96103
```python
97-
def saveSticker(sticker: Sticker, path: str) -> str:
104+
async def downloadPack(
105+
packId: str, packKey: str, cwd: str = os.getcwd()
106+
) -> tuple[str, str]:
107+
...
98108
```
99109

110+
111+
112+
## saveSticker
113+
114+
[Show source in downloader.py:35](../../../sigstickers/downloader.py#L35)
115+
100116
Save a sticker
101117

102118
#### Arguments
@@ -107,3 +123,12 @@ Save a sticker
107123
#### Returns
108124

109125
- `str` - the filepath the file was written to
126+
127+
#### Signature
128+
129+
```python
130+
def saveSticker(sticker: Sticker, path: str) -> str:
131+
...
132+
```
133+
134+
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
# Sigstickers
22

3-
> Auto-generated documentation for [sigstickers](../../../sigstickers/__init__.py) module.
3+
[Sigstickers Index](../README.md#sigstickers-index) /
4+
Sigstickers
45

5-
Download sticker packs from Signal
6+
> Auto-generated documentation for [sigstickers](../../../sigstickers/__init__.py) module.
67
7-
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / Sigstickers
8-
- [cli](#cli)
9-
- Modules
10-
- [Module](module.md#module)
11-
- [Caching](caching.md#caching)
12-
- [Downloader](downloader.md#downloader)
8+
- [Sigstickers](#sigstickers)
9+
- [cli](#cli)
10+
- [Modules](#modules)
1311

1412
## cli
1513

16-
[[find in source code]](../../../sigstickers/__init__.py#L13)
14+
[Show source in __init__.py:13](../../../sigstickers/__init__.py#L13)
15+
16+
cli entry point
17+
18+
#### Signature
1719

1820
```python
1921
def cli():
22+
...
2023
```
2124

22-
cli entry point
25+
26+
27+
## Modules
28+
29+
- [Module](./module.md)
30+
- [Caching](./caching.md)
31+
- [Downloader](./downloader.md)
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Module
22

3-
> Auto-generated documentation for [sigstickers.__main__](../../../sigstickers/__main__.py) module.
3+
[Sigstickers Index](../README.md#sigstickers-index) /
4+
[Sigstickers](./index.md#sigstickers) /
5+
Module
46

5-
entry point for python -m sigstickers
7+
> Auto-generated documentation for [sigstickers.__main__](../../../sigstickers/__main__.py) module.
68
7-
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / [Sigstickers](index.md#sigstickers) / Module
9+
- [Module](#module)

0 commit comments

Comments
 (0)