Organise imports

This commit is contained in:
Ben 2020-03-26 22:10:58 +00:00
parent 7af9344a00
commit 613510f8f7
53 changed files with 228 additions and 258 deletions

View File

@ -1,9 +1,9 @@
import argparse
import asyncio
import logging
import argparse
from houdini.constants import ClientType, ConflictResolution, Language
from houdini.houdini import Houdini
from houdini.constants import Language, ConflictResolution, ClientType
if __name__ == '__main__':
logger = logging.getLogger('houdini')

View File

@ -1,11 +1,10 @@
import asyncio
import importlib
import logging
import pkgutil
from abc import ABC, abstractmethod
from collections import OrderedDict
from types import FunctionType
from abc import abstractmethod
import asyncio
import logging
import importlib
import pkgutil
def get_package_modules(package):

View File

@ -1,10 +1,7 @@
import inspect
from houdini import handlers
from houdini import plugins
from houdini import _AbstractManager
from houdini import _AbstractManager, handlers, plugins
from houdini.constants import ConflictResolution
from houdini.converters import _ArgumentDeserializer, _listener

View File

@ -1,18 +1,15 @@
from abc import ABC
from abc import abstractmethod
import asyncio
import itertools
import inspect
import collections
import inspect
import itertools
from abc import ABC, abstractmethod
from houdini.cooldown import CooldownError
from houdini.data.room import Room
from houdini.data.igloo import Flooring, Furniture, Igloo, Location
from houdini.data.item import Item
from houdini.data.igloo import Igloo, Furniture, Flooring, Location
from houdini.data.pet import PenguinPuffle, Puffle
from houdini.data.room import Room
from houdini.data.stamp import Stamp
from houdini.data.pet import Puffle, PenguinPuffle
class ChecklistError(Exception):

View File

@ -1,6 +1,7 @@
from gino import Gino
from collections.abc import Mapping
from gino import Gino
db = Gino()

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class BuddyList(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class DanceSong(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Flooring(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Item(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Postcard(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Ban(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Card(db.Model):

View File

@ -1,9 +1,8 @@
from datetime import datetime
from functools import lru_cache
from houdini.data import db
from functools import lru_cache
class Penguin(db.Model):
__tablename__ = 'penguin'

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Permission(db.Model):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Puffle(db.Model):

View File

@ -1,9 +1,4 @@
from houdini.games.sled import SledRacingLogic
from houdini.games.four import ConnectFourLogic
from houdini.games.mancala import MancalaLogic
from houdini.games.treasure import TreasureHuntLogic
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
def stealth_mod_filter(stealth_mod_id):

View File

@ -1,4 +1,4 @@
from houdini.data import db, AbstractDataCollection
from houdini.data import AbstractDataCollection, db
class Stamp(db.Model):

View File

@ -1,12 +1,12 @@
import inspect
import enum
import inspect
import itertools
from types import FunctionType
from houdini.converters import _listener, _ArgumentDeserializer, get_converter, \
do_conversion, _ConverterContext, ChecklistError
from houdini.cooldown import _Cooldown, _CooldownMapping, BucketType, CooldownError
from houdini import plugins, _AbstractManager, get_package_modules
from houdini import _AbstractManager, get_package_modules, plugins
from houdini.converters import ChecklistError, _ArgumentDeserializer, _ConverterContext, _listener, do_conversion, \
get_converter
from houdini.cooldown import BucketType, CooldownError, _Cooldown, _CooldownMapping
class AuthorityError(Exception):

View File

@ -1,17 +1,16 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.converters import OptionalConverter
from houdini.constants import ClientType
from houdini.handlers.play.navigation import handle_join_room
from houdini.handlers.play.moderation import cheat_ban
from houdini.data.room import Room
from houdini.data.game import PenguinGameData
import random
import time
from sqlalchemy.dialects.postgresql import insert
import time
import random
from houdini import handlers
from houdini.constants import ClientType
from houdini.converters import OptionalConverter
from houdini.data.game import PenguinGameData
from houdini.data.room import Room
from houdini.handlers import XTPacket
from houdini.handlers.play.moderation import cheat_ban
from houdini.handlers.play.navigation import handle_join_room
default_score_games = {904, 905, 906, 912, 916, 917, 918, 919, 950, 952}

View File

@ -1,15 +1,14 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.data.dance import DanceSongCollection
from houdini.penguin import Penguin
import random
import time
import asyncio
import itertools
import random
import time
from dataclasses import dataclass
from houdini import handlers
from houdini.data.dance import DanceSongCollection
from houdini.handlers import XTPacket
from houdini.penguin import Penguin
@dataclass
class Dancer:

View File

@ -1,7 +1,7 @@
from houdini import handlers
from houdini import ITable, handlers
from houdini.handlers import XTPacket
from houdini.handlers.games.table import table_handler
from houdini.games.four import ConnectFourLogic
@handlers.handler(XTPacket('gz', ext='z'))

View File

@ -1,7 +1,7 @@
from houdini import handlers
from houdini import ITable, handlers
from houdini.handlers import XTPacket
from houdini.handlers.games.table import table_handler
from houdini.games.mancala import MancalaLogic
@handlers.handler(XTPacket('gz', ext='z'))

View File

@ -1,7 +1,7 @@
from houdini import handlers
from houdini import IWaddle, handlers
from houdini.handlers import XTPacket
from houdini.handlers.games.waddle import waddle_handler
from houdini.games.sled import SledRacingLogic
@handlers.handler(XTPacket('jz', ext='z'))

View File

@ -1,7 +1,9 @@
from houdini import handlers
import random
from houdini import ITable, handlers
from houdini.handlers import XTPacket
from houdini.handlers.games.table import table_handler
from houdini.games.treasure import TreasureHuntLogic
@handlers.handler(XTPacket('gz', ext='z'))

View File

@ -1,9 +1,8 @@
from houdini import handlers
from houdini.handlers import XMLPacket
from houdini.converters import VersionChkConverter
from houdini.constants import ClientType
from houdini.converters import VersionChkConverter
from houdini.data.buddy import BuddyList
from houdini.handlers import XMLPacket
@handlers.handler(XMLPacket('verChk'))

View File

@ -1,18 +1,18 @@
import asyncio
import os
from datetime import datetime, timedelta
import bcrypt
from houdini import handlers
from houdini.constants import ClientType
from houdini.converters import Credentials
from houdini.crypto import Crypto
from houdini.data.moderator import Ban
from houdini.data.penguin import Penguin
from houdini.handlers import XMLPacket
from houdini.handlers.login import get_server_presence
from houdini.handlers.play.navigation import get_minutes_played_today
from houdini.converters import Credentials
from houdini.data.penguin import Penguin
from houdini.data.moderator import Ban
from houdini.crypto import Crypto
from houdini.constants import ClientType
import asyncio
import bcrypt
import os
from datetime import datetime, timedelta
@handlers.handler(XMLPacket('login'))

View File

@ -1,13 +1,13 @@
from houdini import handlers
from houdini.handlers import XMLPacket, login
from houdini.converters import WorldCredentials, Credentials
from houdini.data.penguin import Penguin
from houdini.data.moderator import Ban
from houdini.crypto import Crypto
from houdini.constants import ClientType
from datetime import datetime
from houdini import handlers
from houdini.constants import ClientType
from houdini.converters import Credentials, WorldCredentials
from houdini.crypto import Crypto
from houdini.data.moderator import Ban
from houdini.data.penguin import Penguin
from houdini.handlers import XMLPacket, login
handle_version_check = login.handle_version_check
handle_random_key = login.handle_random_key

View File

@ -1,6 +1,6 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.constants import ClientType
from houdini.handlers import XTPacket
@handlers.handler(XTPacket('pt', 'spts'), client=ClientType.Vanilla)

View File

@ -1,12 +1,10 @@
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket
from houdini.handlers.play.navigation import handle_join_room
from houdini.handlers import Priority
from houdini.data.penguin import Penguin
from houdini.data.buddy import BuddyList, BuddyRequest, BuddyListCollection, \
BuddyRequestCollection, CharacterBuddyCollection, CharacterCollection
from houdini.constants import ClientType
from houdini.data.buddy import BuddyList, BuddyListCollection, BuddyRequest, BuddyRequestCollection, \
CharacterBuddyCollection, CharacterCollection
from houdini.data.penguin import Penguin
from houdini.handlers import Priority, XMLPacket, XTPacket
from houdini.handlers.play.navigation import handle_join_room
async def update_player_presence(p):

View File

@ -1,17 +1,16 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.handlers.play.mail import handle_start_mail_engine
import datetime
import random
import time
from aiocache import cached
from houdini import handlers
from houdini.constants import ClientType
from houdini.data.item import Item
from houdini.data.mail import PenguinPostcard
from houdini.data.penguin import EpfComMessage
from houdini.constants import ClientType
import datetime
import time
import random
from aiocache import cached
from houdini.handlers import XTPacket
from houdini.handlers.play.mail import handle_start_mail_engine
@cached(alias='default', key='com_messages')

View File

@ -1,14 +1,13 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.handlers.play.navigation import handle_join_server, handle_join_room, handle_join_player_room
from houdini.data import db
from houdini.data.quest import Quest, QuestAwardItem, QuestAwardFurniture, QuestAwardPuffleItem, QuestTask
from houdini.data.quest import PenguinQuestTask
import ujson
from aiocache import cached
from houdini import handlers
from houdini.data import db
from houdini.data.quest import PenguinQuestTask, Quest, QuestAwardFurniture, QuestAwardItem, QuestAwardPuffleItem, \
QuestTask
from houdini.handlers import XTPacket
from houdini.handlers.play.navigation import handle_join_player_room, handle_join_room, handle_join_server
def get_status_key(_, p):
return f'quest.status.{p.id}'

View File

@ -1,28 +1,23 @@
import itertools
import ujson
import time
from datetime import datetime, timedelta
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket, Priority
from houdini.converters import SeparatorConverter
from houdini.constants import ClientType, StatusField
from houdini.handlers.play.navigation import handle_join_server
from houdini.data import db
from houdini.data.penguin import Penguin
from houdini.data.room import PenguinIglooRoom
from houdini.data.igloo import IglooFurniture, IglooLike, Igloo, Furniture, Flooring, Location, \
IglooCollection, FurnitureCollection, \
FlooringCollection, LocationCollection,\
PenguinIglooCollection, PenguinFurnitureCollection, \
PenguinFlooringCollection, PenguinLocationCollection
from houdini.data.room import PenguinIglooRoomCollection
from houdini.data.game import PenguinGameData
import ujson
from aiocache import cached
from sqlalchemy.dialects.postgresql import insert
from aiocache import cached
from houdini import handlers
from houdini.constants import ClientType, StatusField
from houdini.converters import SeparatorConverter
from houdini.data import db
from houdini.data.game import PenguinGameData
from houdini.data.igloo import Flooring, FlooringCollection, Furniture, FurnitureCollection, Igloo, IglooCollection, \
IglooFurniture, IglooLike, Location, LocationCollection, PenguinFlooringCollection, PenguinFurnitureCollection, \
PenguinIglooCollection, PenguinLocationCollection
from houdini.data.penguin import Penguin
from houdini.data.room import PenguinIglooRoom, PenguinIglooRoomCollection
from houdini.handlers import Priority, XMLPacket, XTPacket
from houdini.handlers.play.navigation import handle_join_server
def get_layout_furniture_key(_, p, igloo_id):

View File

@ -1,8 +1,7 @@
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket, Priority
from houdini.data.penguin import Penguin
from houdini.data.buddy import IgnoreList, IgnoreListCollection
from houdini.data.penguin import Penguin
from houdini.handlers import Priority, XMLPacket, XTPacket
@handlers.handler(XMLPacket('login'), priority=Priority.Low)

View File

@ -1,11 +1,12 @@
import operator
import time
from aiocache import cached
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket, Priority
from houdini.data.item import Item, ItemCollection, PenguinItemCollection
from houdini.data.permission import PenguinPermissionCollection
import time
from aiocache import cached
import operator
from houdini.handlers import Priority, XMLPacket, XTPacket
def get_pin_string_key(_, p, player_id):

View File

@ -1,12 +1,11 @@
from houdini import handlers
from houdini.handlers import XTPacket
import time
from houdini import handlers
from houdini.data import db
from houdini.data.penguin import Penguin
from houdini.data.buddy import IgnoreList
from houdini.data.mail import PenguinPostcard, PostcardCollection
import time
from houdini.data.penguin import Penguin
from houdini.handlers import XTPacket
@handlers.boot

View File

@ -1,11 +1,9 @@
from houdini import handlers
from houdini.commands import has_command_prefix, invoke_command_string
from houdini.data.moderator import ChatFilterRuleCollection
from houdini.handlers import XTPacket
from houdini.handlers.play.moderation import moderator_ban
from houdini.commands import invoke_command_string, has_command_prefix
from houdini.data.moderator import ChatFilterRuleCollection
@handlers.boot
async def filter_load(server):

View File

@ -1,12 +1,12 @@
from houdini import handlers
from houdini.data import db
from houdini.handlers import XTPacket
from houdini.data.moderator import Ban, Warning, Report
from houdini.data.penguin import Penguin
from houdini.constants import ClientType
import datetime
from houdini import handlers
from houdini.constants import ClientType
from houdini.data import db
from houdini.data.moderator import Ban, Report, Warning
from houdini.data.penguin import Penguin
from houdini.handlers import XTPacket
@handlers.handler(XTPacket('o', 'k'))
async def handle_kick_player(p, penguin_id: int):

View File

@ -1,16 +1,15 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.data import db
from houdini.data.music import PenguinTrack, TrackLike
from houdini.constants import ClientType
from houdini.crypto import Crypto
import asyncio
import re
from datetime import date, datetime
from gino.loader import ColumnLoader
from datetime import datetime, date
import asyncio
import re
from houdini import handlers
from houdini.constants import ClientType
from houdini.crypto import Crypto
from houdini.data import db
from houdini.data.music import PenguinTrack, TrackLike
from houdini.handlers import XTPacket
class SoundStudio:

View File

@ -1,10 +1,23 @@
import hashlib
import random
import time
from datetime import date, datetime
import pytz
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.data import db
from houdini.data.room import Room
from houdini.data.penguin import Penguin, Login
from houdini.data.room import PenguinIglooRoom, PenguinBackyardRoom, RoomCollection
from houdini.constants import ClientType, StatusField
from houdini.data import db
from houdini.data.penguin import Login, Penguin
from houdini.data.room import PenguinBackyardRoom, PenguinIglooRoom, Room, RoomCollection, RoomTable, RoomWaddle
from houdini.handlers import XTPacket
from houdini.handlers.games.four import ConnectFourLogic
from houdini.handlers.games.mancala import MancalaLogic
from houdini.handlers.games.ninja.card import CardJitsuLogic, SenseiLogic
from houdini.handlers.games.ninja.fire import CardJitsuFireLogic, FireSenseiLogic
from houdini.handlers.games.ninja.water import CardJitsuWaterLogic, WaterSenseiLogic
from houdini.handlers.games.sled import SledRacingLogic
from houdini.handlers.games.treasure import TreasureHuntLogic
import random
import time

View File

@ -1,6 +1,5 @@
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket, Priority
from houdini.data.ninja import PenguinCardCollection, CardCollection
from houdini.handlers import XTPacket
@handlers.boot

View File

@ -1,9 +1,7 @@
from houdini import handlers
from houdini.handlers import XTPacket
import ujson
from houdini import handlers
from houdini.handlers import XTPacket
DefaultPartyCookie = {
'msgViewedArray': [0] * 10,

View File

@ -1,21 +1,16 @@
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket, Priority
from houdini.constants import ClientType, StatusField
from houdini.data.pet import PenguinPuffleCollection, PenguinPuffleItemCollection, PenguinPuffle, \
PuffleCollection, PuffleItemCollection, \
PuffleTreasureFurniture, PuffleTreasureItem, \
PuffleTreasurePuffleItem
from houdini.data.room import PenguinBackyardRoom, PenguinIglooRoom
from houdini.data.mail import PenguinPostcard
from datetime import datetime, timedelta
import time
import random
import asyncio
import operator
import random
import time
from datetime import datetime, timedelta
from houdini import handlers
from houdini.constants import ClientType, StatusField
from houdini.data.mail import PenguinPostcard
from houdini.data.pet import PenguinPuffle, PenguinPuffleCollection, PenguinPuffleItemCollection, PuffleCollection, \
PuffleItemCollection, PuffleTreasureFurniture, PuffleTreasureItem, PuffleTreasurePuffleItem
from houdini.data.room import PenguinBackyardRoom, PenguinIglooRoom
from houdini.handlers import Priority, XMLPacket, XTPacket
PuffleKillerInterval = 600
LegacyPuffleIds = [0, 1, 2, 3, 4, 5, 6, 7, 8]

View File

@ -1,16 +1,17 @@
from houdini import handlers
from houdini.converters import SeparatorConverter
from houdini.handlers import XTPacket, XMLPacket, Priority
from houdini.data import db
from houdini.data.penguin import Penguin, PenguinMembership
from houdini.data.mail import PenguinPostcard
from houdini.constants import ClientType
import asyncio
import random
import time
from datetime import datetime, timedelta
from aiocache import cached
from datetime import datetime, timedelta
import random
import asyncio
import time
from houdini import handlers
from houdini.constants import ClientType
from houdini.converters import SeparatorConverter
from houdini.data import db
from houdini.data.mail import PenguinPostcard
from houdini.data.penguin import Penguin, PenguinMembership
from houdini.handlers import Priority, XMLPacket, XTPacket
def get_player_string_key(_, p, player_id):

View File

@ -1,12 +1,11 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.constants import ClientType
import time
from datetime import datetime, timedelta
import ujson
import time
from houdini import handlers
from houdini.constants import ClientType
from houdini.handlers import XTPacket
RainbowQuestRewards = [6158, 4809, 1560, 3159]
RainbowBonusReward = 5220

View File

@ -1,9 +1,9 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.data.penguin import Penguin
import random
from houdini import handlers
from houdini.data.penguin import Penguin
from houdini.handlers import XTPacket
@handlers.handler(XTPacket('r', 'cdu'))
@handlers.cooldown(1)

View File

@ -1,7 +1,6 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.data.item import Item
from houdini.handlers import XTPacket
@handlers.handler(XTPacket('s', 'upc'))

View File

@ -1,11 +1,11 @@
from houdini import handlers
from houdini.handlers import XMLPacket, XTPacket, Priority
from houdini.handlers.play.navigation import handle_join_server, handle_join_room
from houdini.data.stamp import Stamp, CoverStamp, CoverItem, PenguinStampCollection, StampCollection
from houdini.data.penguin import Penguin
from aiocache import cached
from houdini import handlers
from houdini.data.penguin import Penguin
from houdini.data.stamp import CoverItem, CoverStamp, PenguinStampCollection, Stamp, StampCollection
from houdini.handlers import Priority, XMLPacket, XTPacket
from houdini.handlers.play.navigation import handle_join_room, handle_join_server
def get_book_cover_key(_, p, player_id):
return f'book.{player_id}'

View File

@ -1,6 +1,6 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.constants import ClientType
from houdini.handlers import XTPacket
@handlers.handler(XTPacket('t', 'at'))

View File

@ -1,14 +1,13 @@
from houdini import handlers
from houdini.handlers import XTPacket
from houdini.constants import ClientType
from houdini.data import db
from houdini.data.redemption import RedemptionCode, RedemptionAwardCard, RedemptionAwardFlooring, \
RedemptionAwardFurniture, RedemptionAwardIgloo, RedemptionAwardItem, RedemptionAwardLocation,\
RedemptionAwardPuffle, RedemptionAwardPuffleItem, PenguinRedemptionBook, PenguinRedemptionCode
from datetime import datetime
from houdini import handlers
from houdini.constants import ClientType
from houdini.data import db
from houdini.data.redemption import PenguinRedemptionBook, PenguinRedemptionCode, RedemptionAwardCard, \
RedemptionAwardFlooring, RedemptionAwardFurniture, RedemptionAwardIgloo, RedemptionAwardItem, \
RedemptionAwardLocation, RedemptionAwardPuffle, RedemptionAwardPuffleItem, RedemptionCode
from houdini.handlers import XTPacket
@handlers.handler(XTPacket('rjs', ext='red'), pre_login=True, client=ClientType.Vanilla)
@handlers.allow_once

View File

@ -1,19 +1,17 @@
import asyncio
import logging
import os
import sys
from houdini.spheniscidae import Spheniscidae
from houdini.penguin import Penguin
from houdini import PenguinStringCompiler
import logging
from logging.handlers import RotatingFileHandler
import aioredis
from aiocache import SimpleMemoryCache, caches
from houdini import PenguinStringCompiler
from houdini.data import db
from houdini.data.permission import PermissionCollection
from houdini.penguin import Penguin
from houdini.spheniscidae import Spheniscidae
try:
import uvloop
@ -32,7 +30,6 @@ from houdini.handlers.play.player import server_heartbeat, server_egg_timer
from houdini.handlers.play.pet import decrease_stats
from houdini.handlers.play.music import SoundStudio
from houdini.handlers.games.dance import DanceFloor
class Houdini:

View File

@ -1,9 +1,9 @@
import time
from houdini.spheniscidae import Spheniscidae
from houdini.data import penguin
from houdini.data.mail import PenguinPostcard
from houdini.handlers.play.pet import get_my_player_walking_puffle
from houdini.spheniscidae import Spheniscidae
class Penguin(Spheniscidae, penguin.Penguin):

View File

@ -1,7 +1,5 @@
from abc import ABC
from abc import abstractmethod
import inspect
from abc import ABC, abstractmethod
from houdini import _AbstractManager, get_package_modules

View File

@ -1,12 +1,10 @@
from houdini.handlers import XMLPacket, XTPacket
from asyncio import IncompleteReadError, CancelledError
import defusedxml.cElementTree as Et
from asyncio import CancelledError, IncompleteReadError
from xml.etree.cElementTree import Element, SubElement, tostring
import defusedxml.cElementTree as Et
from houdini.constants import ClientType
from houdini.handlers import AuthorityError
from houdini.handlers import AuthorityError, XMLPacket, XTPacket
class Spheniscidae: