Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PyPlanet/PyPlanet into release/0.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvlk committed Nov 16, 2018
2 parents 2e6559a + 3b96b86 commit cc24567
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Changelog
=========

0.6.2 (17 November 2018)
------------------------

Core
~~~~

* Security: Upgraded library to solve security issues (requests library).

* Bugfix: Fixing issues with the command line interface and showing settings error, preventing executing commands outside project

Apps
~~~~

* Bugfix: Fix issue with clearing the jukebox and locking up the whole jukebox app.


0.6.1 (7 October 2018)
----------------------

Expand Down
9 changes: 8 additions & 1 deletion pyplanet/apps/contrib/jukebox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def append_map(self, player, map):

def empty_jukebox(self):
self.jukebox.clear()
self.lock.release()

async def show_map_list(self, player, data, **kwargs):
view = MapListView(self, player)
Expand Down Expand Up @@ -88,7 +89,13 @@ async def chat_command(self, player, data, **kwargs):
message = '$i$f00You\'re not allowed to do this!'
await self.instance.chat(message, player)
else:
await self.clear_jukebox(player, data)
if len(self.jukebox) > 0:
self.jukebox.clear()
message = '$ff0Admin $fff{}$z$s$ff0 has cleared the jukebox.'.format(player.nickname)
await self.instance.chat(message)
else:
message = '$i$f00There are currently no maps in the jukebox.'
await self.instance.chat(message, player)

else:
await self.display_chat_commands(player)
Expand Down
9 changes: 5 additions & 4 deletions pyplanet/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class LazySettings:
def __init__(self):
self._settings = None

def _setup(self):
def _setup(self, optional_loading=False):
"""
Setup will create the wrapped settings and load the settings module.
"""
settings_method = os.environ.get('PYPLANET_SETTINGS_METHOD', 'python')
if not settings_method:
if not settings_method and not optional_loading:
raise ImproperlyConfigured(
'Settings method is not defined! Please define PYPLANET_SETTINGS_METHOD in your '
'environment or start script. The possible values: \'python\', \'json\', \'yaml\''
Expand All @@ -55,8 +55,9 @@ def _setup(self):
try:
self._settings.load()
except Exception as e:
logging.exception(e)
exit(1)
if not optional_loading:
logging.exception(e)
exit(1)

def __getattr__(self, item):
"""
Expand Down
3 changes: 1 addition & 2 deletions pyplanet/conf/backends/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def load(self):

if not self.module:
raise ImproperlyConfigured(
'Settings module is not defined! Please define PYPLANET_SETTINGS_MODULE in your '
'environment or start script.'
'Settings module is not defined! Please define PYPLANET_SETTINGS_MODULE in your environment or start script.'
)

# Add the module itself to the configuration.
Expand Down
3 changes: 3 additions & 0 deletions pyplanet/core/management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def __init__(self, argv):

self.commands = find_commands(__path__[0])

settings._setup(optional_loading=True)

def fetch_command(self, subcommand):
"""
Try to fetch the given subcommand, printing a message with the
Expand Down Expand Up @@ -252,5 +254,6 @@ def autocomplete(self):

def execute_from_command_line(argv=None):
"""Run a ManagementUtility."""
settings._optional = True
utility = ManagementUtility(argv)
utility.execute()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ asyncssh==1.14.0

# Network
aiohttp==2.3.9
requests==2.19.1
requests==2.20.1
urllib3==1.23

# Utils
Expand Down
2 changes: 1 addition & 1 deletion tests/_scripts/travis_dedicated_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd ../../
# From now we are in the project root.

# Download the latest dedicated server.
wget http://files.v04.maniaplanet.com/server/ManiaplanetServer_2018-07-03.zip -O ./dedicated.zip
wget http://files.v04.maniaplanet.com/server/ManiaplanetServer_2018-11-15.zip -O ./dedicated.zip

# Unzip the dedicated into the subdirectory.
mkdir -p ./dedicated
Expand Down

0 comments on commit cc24567

Please sign in to comment.