Skip to content

Commit 76ea4a0

Browse files
authored
v2.0.1 (#5)
* rewrite * v2.0.1
1 parent 632bc74 commit 76ea4a0

File tree

14 files changed

+35399
-76
lines changed

14 files changed

+35399
-76
lines changed

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.vscode
2-
__pycache__
3-
/*.json
1+
.vscode
2+
__pycache__
43
jsons

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,39 @@ for item in inventory:
5353
### BackpackTF Websocket
5454
#### Handle one listing at a time
5555
```python
56-
from tf2_utils import BackpackTFWebsocket
56+
from tf2_utils import BackpackTFSocket
5757

5858
def my_function(data: dict):
5959
print("got data!", data)
6060

61-
socket = BackpackTFWebsocket(my_function)
61+
socket = BackpackTFSocket(my_function)
6262

6363
socket.listen()
6464
```
6565

6666
#### Handle list of listings at a time
6767
```python
68-
from tf2_utils import BackpackTFWebsocket
68+
from tf2_utils import BackpackTFSocket
6969

7070
def my_function(data: list[dict]):
7171
print("got listings")
7272

7373
for listing in data:
7474
print("listing", listing)
7575

76-
socket = BackpackTFWebsocket(my_function, solo_entries=False)
76+
socket = BackpackTFSocket(my_function, solo_entries=False)
77+
78+
socket.listen()
79+
```
80+
81+
### PricesTF Websocket
82+
```python
83+
from tf2_utils import PricesTFSocket
84+
85+
def my_function(data: dict):
86+
print("got data!", data)
87+
88+
socket = PricesTFSocket(my_function)
7789

7890
socket.listen()
7991
```
@@ -88,8 +100,8 @@ python -m pip install tf2-utils
88100

89101
### Upgrade
90102
```bash
91-
pip upgrade tf2-utils
103+
pip install upgrade tf2-utils
92104
# or
93-
python -m pip upgrade tf2-utils
105+
python -m pip install upgrade tf2-utils
94106
```
95107

examples/backpack_tf_socket.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from tf2_utils import BackpackTFSocket
2+
3+
4+
def my_function(data: dict):
5+
print("got data!", data)
6+
7+
8+
socket = BackpackTFSocket(my_function)
9+
10+
socket.listen()

0 commit comments

Comments
 (0)