Continued conversions
This commit is contained in:
parent
7d6a4b44f5
commit
b4cc3d0ac2
4 changed files with 30 additions and 37 deletions
|
|
@ -501,7 +501,7 @@ def _print_info(portal_info_dict, server_info_dict):
|
||||||
|
|
||||||
def _prepare_dict(dct):
|
def _prepare_dict(dct):
|
||||||
out = {}
|
out = {}
|
||||||
for key, value in dct.iteritems():
|
for key, value in dct.items():
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
value = "\n{}".format(ind).join(value)
|
value = "\n{}".format(ind).join(value)
|
||||||
out[key] = value
|
out[key] = value
|
||||||
|
|
@ -576,9 +576,9 @@ class MsgStatus(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "MsgStatus"
|
key = "MsgStatus"
|
||||||
arguments = [('status', amp.String())]
|
arguments = [(b'status', amp.String())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = [('status', amp.String())]
|
response = [(b'status', amp.String())]
|
||||||
|
|
||||||
|
|
||||||
class MsgLauncher2Portal(amp.Command):
|
class MsgLauncher2Portal(amp.Command):
|
||||||
|
|
@ -587,9 +587,9 @@ class MsgLauncher2Portal(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "MsgLauncher2Portal"
|
key = "MsgLauncher2Portal"
|
||||||
arguments = [('operation', amp.String()),
|
arguments = [(b'operation', amp.String()),
|
||||||
('arguments', amp.String())]
|
(b'arguments', amp.String())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = []
|
response = []
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,14 @@ The AMP (Asynchronous Message Protocol)-communication commands and constants use
|
||||||
This module acts as a central place for AMP-servers and -clients to get commands to use.
|
This module acts as a central place for AMP-servers and -clients to get commands to use.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import time
|
import time
|
||||||
from twisted.protocols import amp
|
from twisted.protocols import amp
|
||||||
from collections import defaultdict, namedtuple
|
from collections import defaultdict, namedtuple
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
from itertools import count
|
from itertools import count
|
||||||
import zlib # Used in Compressed class
|
import zlib # Used in Compressed class
|
||||||
try:
|
|
||||||
import cPickle as pickle
|
|
||||||
except ImportError:
|
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
from twisted.internet.defer import DeferredList, Deferred
|
from twisted.internet.defer import DeferredList, Deferred
|
||||||
|
|
@ -159,9 +156,9 @@ class MsgLauncher2Portal(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "MsgLauncher2Portal"
|
key = "MsgLauncher2Portal"
|
||||||
arguments = [('operation', amp.String()),
|
arguments = [(b'operation', amp.String()),
|
||||||
('arguments', amp.String())]
|
(b'arguments', amp.String())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = []
|
response = []
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -171,8 +168,8 @@ class MsgPortal2Server(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "MsgPortal2Server"
|
key = "MsgPortal2Server"
|
||||||
arguments = [('packed_data', Compressed())]
|
arguments = [(b'packed_data', Compressed())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = []
|
response = []
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -182,8 +179,8 @@ class MsgServer2Portal(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "MsgServer2Portal"
|
key = "MsgServer2Portal"
|
||||||
arguments = [('packed_data', Compressed())]
|
arguments = [(b'packed_data', Compressed())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = []
|
response = []
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -196,8 +193,8 @@ class AdminPortal2Server(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "AdminPortal2Server"
|
key = "AdminPortal2Server"
|
||||||
arguments = [('packed_data', Compressed())]
|
arguments = [(b'packed_data', Compressed())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = []
|
response = []
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -210,8 +207,8 @@ class AdminServer2Portal(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "AdminServer2Portal"
|
key = "AdminServer2Portal"
|
||||||
arguments = [('packed_data', Compressed())]
|
arguments = [(b'packed_data', Compressed())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = []
|
response = []
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -221,9 +218,9 @@ class MsgStatus(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "MsgStatus"
|
key = "MsgStatus"
|
||||||
arguments = [('status', amp.String())]
|
arguments = [(b'status', amp.String())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = [('status', amp.String())]
|
response = [(b'status', amp.String())]
|
||||||
|
|
||||||
|
|
||||||
class FunctionCall(amp.Command):
|
class FunctionCall(amp.Command):
|
||||||
|
|
@ -235,12 +232,12 @@ class FunctionCall(amp.Command):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
key = "FunctionCall"
|
key = "FunctionCall"
|
||||||
arguments = [('module', amp.String()),
|
arguments = [(b'module', amp.String()),
|
||||||
('function', amp.String()),
|
(b'function', amp.String()),
|
||||||
('args', amp.String()),
|
(b'args', amp.String()),
|
||||||
('kwargs', amp.String())]
|
(b'kwargs', amp.String())]
|
||||||
errors = {Exception: 'EXCEPTION'}
|
errors = {Exception: b'EXCEPTION'}
|
||||||
response = [('result', amp.String())]
|
response = [(b'result', amp.String())]
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ This is a simple context factory for auto-creating
|
||||||
SSL keys and certificates.
|
SSL keys and certificates.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ when starting and will warn if this was not possible. These will appear as files
|
||||||
ssl.cert in mygame/server/.
|
ssl.cert in mygame/server/.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
try:
|
try:
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue