Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed Jul 1, 2023
1 parent 9af794f commit 4b2fbf6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
4 changes: 3 additions & 1 deletion rustplus/api/remote/events/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ async def run_entity_event(
return

for handler in handlers.copy():
await handler.get_coro()(EntityEvent(app_message, handler.get_entity_type()))
await handler.get_coro()(
EntityEvent(app_message, handler.get_entity_type())
)

@staticmethod
async def run_team_event(app_message: AppMessage, server_id: ServerID) -> None:
Expand Down
15 changes: 11 additions & 4 deletions rustplus/api/remote/events/registered_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@


class RegisteredListener:
def __init__(self, listener_id: Union[str, int], coroutine: Coroutine, entity_type: int = None) -> None:
def __init__(
self,
listener_id: Union[str, int],
coroutine: Coroutine,
entity_type: int = None,
) -> None:
self.listener_id = str(listener_id)
self._coroutine = coroutine
self._entity_type = entity_type
Expand All @@ -17,9 +22,11 @@ def __eq__(self, other) -> bool:
if not isinstance(other, RegisteredListener):
return False

return self.listener_id == other.listener_id and \
self._coroutine == other.get_coro() and \
self._entity_type == other.get_entity_type()
return (
self.listener_id == other.listener_id
and self._coroutine == other.get_coro()
and self._entity_type == other.get_entity_type()
)

def __hash__(self):
return hash((self.listener_id, self._coroutine, self._entity_type))
5 changes: 1 addition & 4 deletions rustplus/api/remote/expo_bundle_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
class MagicValueGrabber:
@staticmethod
def get_magic_value() -> int:

data = requests.get(
"https://companion-rust.facepunch.com/api/version"
)
data = requests.get("https://companion-rust.facepunch.com/api/version")

if data.status_code == 200:
data = data.json()
Expand Down
16 changes: 10 additions & 6 deletions rustplus/utils/grab_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
"2106561762": "Decorative Tinsel",
"2114754781": "Water Purifier",
"2126889441": "Santa Beard",
"2133269020": "Red Berry Clone"
"2133269020": "Red Berry Clone",
}
stack_to_id = {}

Expand All @@ -765,7 +765,7 @@ def translate_stack_to_id(item: str) -> int:
return "Not Found"


def grab_items(reversed = False) -> None:
def grab_items(reversed=False) -> None:
data = {}

for line in (
Expand All @@ -775,14 +775,18 @@ def grab_items(reversed = False) -> None:
.content.decode()
.splitlines(False)[2:]
):
if len(line) == 0: continue
if len(line) == 0:
continue

item = line.split("|")[1:-1]

if item[1] == "" or item[2] == "N/A": continue
if item[1] == "" or item[2] == "N/A":
continue

if not reversed: data[int(item[2])] = item[0]
else: data[str(item[0])] = int(item[2])
if not reversed:
data[int(item[2])] = item[0]
else:
data[str(item[0])] = int(item[2])

with open("rust_items.json", "w") as output:
json.dump(data, output, indent=4, sort_keys=True)
Expand Down

0 comments on commit 4b2fbf6

Please sign in to comment.