mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 12:37:16 +02:00
PEP8 cleanup of the entire codebase. Unchanged are many cases of too-long lines, partly because of the rewrite they would require but also because splitting many lines up would make the code harder to read. Also the third-party libraries (idmapper, prettytable etc) were not cleaned.
This commit is contained in:
parent
30b7d2a405
commit
1ae17bcbe4
154 changed files with 5613 additions and 4054 deletions
|
|
@ -3,6 +3,7 @@ Custom manager for ServerConfig objects.
|
|||
"""
|
||||
from django.db import models
|
||||
|
||||
|
||||
class ServerConfigManager(models.Manager):
|
||||
"""
|
||||
This ServerConfigManager implements methods for searching
|
||||
|
|
@ -24,16 +25,16 @@ class ServerConfigManager(models.Manager):
|
|||
"""
|
||||
if not key:
|
||||
return self.all()
|
||||
elif delete == True:
|
||||
elif delete is True:
|
||||
for conf in self.filter(db_key=key):
|
||||
conf.delete()
|
||||
elif value != None:
|
||||
elif value is not None:
|
||||
conf = self.filter(db_key=key)
|
||||
if conf:
|
||||
conf = conf[0]
|
||||
else:
|
||||
conf = self.model(db_key=key)
|
||||
conf.value = value # this will pickle
|
||||
conf.value = value # this will pickle
|
||||
else:
|
||||
conf = self.filter(db_key=key)
|
||||
if not conf:
|
||||
|
|
@ -42,7 +43,8 @@ class ServerConfigManager(models.Manager):
|
|||
|
||||
def get_mysql_db_version(self):
|
||||
"""
|
||||
This is a helper method for getting the version string of a mysql database.
|
||||
This is a helper method for getting the version string
|
||||
of a mysql database.
|
||||
"""
|
||||
from django.db import connection
|
||||
conn = connection.cursor()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue