Skip to content

Commit

Permalink
v2.0.1 (#5)
Browse files Browse the repository at this point in the history
* rewrite

* v2.0.1
  • Loading branch information
offish authored Sep 27, 2023
1 parent 632bc74 commit 76ea4a0
Show file tree
Hide file tree
Showing 14 changed files with 35,399 additions and 76 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.vscode
__pycache__
/*.json
.vscode
__pycache__
jsons
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,39 @@ for item in inventory:
### BackpackTF Websocket
#### Handle one listing at a time
```python
from tf2_utils import BackpackTFWebsocket
from tf2_utils import BackpackTFSocket

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

socket = BackpackTFWebsocket(my_function)
socket = BackpackTFSocket(my_function)

socket.listen()
```

#### Handle list of listings at a time
```python
from tf2_utils import BackpackTFWebsocket
from tf2_utils import BackpackTFSocket

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

for listing in data:
print("listing", listing)

socket = BackpackTFWebsocket(my_function, solo_entries=False)
socket = BackpackTFSocket(my_function, solo_entries=False)

socket.listen()
```

### PricesTF Websocket
```python
from tf2_utils import PricesTFSocket

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

socket = PricesTFSocket(my_function)

socket.listen()
```
Expand All @@ -88,8 +100,8 @@ python -m pip install tf2-utils

### Upgrade
```bash
pip upgrade tf2-utils
pip install upgrade tf2-utils
# or
python -m pip upgrade tf2-utils
python -m pip install upgrade tf2-utils
```

10 changes: 10 additions & 0 deletions examples/backpack_tf_socket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from tf2_utils import BackpackTFSocket


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


socket = BackpackTFSocket(my_function)

socket.listen()
Loading

0 comments on commit 76ea4a0

Please sign in to comment.