mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 07:51:32 +00:00
Adapt existing component examples to refactor
This commit is contained in:
parent
40914e767f
commit
9b5bfcf9c8
@ -1,25 +1,25 @@
|
|||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
|
from component import Component
|
||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
|
||||||
from component import Component
|
|
||||||
|
|
||||||
|
|
||||||
def echo_handler(data):
|
def echo_handler(data):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def rot13_handler(data):
|
def rot13_handler(data, *args):
|
||||||
data['data'] = codecs.encode(data['data'], 'rot13')
|
data['data'] = codecs.encode(data['data'], 'rot13')
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def change_case_handler(data):
|
def change_case_handler(data, *args):
|
||||||
data['data'] = data['data'].upper() if data['data'].islower() else data['data'].lower()
|
data['data'] = data['data'].upper() if data['data'].islower() else data['data'].lower()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def reverse_handler(data):
|
def reverse_handler(data, *args):
|
||||||
data['data'] = data['data'][::-1]
|
data['data'] = data['data'][::-1]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user