py23 compat for defining metaclasses
in python 3 and py2 metaclases are define ddiferentley, using six to get to a common solution
This commit is contained in:
1 parent
f72f948744
commit
94013ddb70
1 file changed
+2
-1
@@ -5,6 +5,7 @@ __author__ = "Marc Hannappel <salandora@gmail.com>"
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import six
|
||||
|
||||
from flask import g, abort
|
||||
from flask_babel import gettext
|
||||
@@ -249,8 +250,8 @@ class PermissionsMetaClass(type):
|
||||
return None
|
||||
|
||||
|
||||
@six.add_metaclass(PermissionsMetaClass)
|
||||
class Permissions(object):
|
||||
__metaclass__ = PermissionsMetaClass
|
||||
|
||||
# Special permission
|
||||
ADMIN = OctoPrintPermission("Admin",
|
||||
|
||||
Reference in new issue
Block a user