forked from pyload/pyload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHandler.py
More file actions
48 lines (40 loc) · 1.32 KB
/
Handler.py
File metadata and controls
48 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#Copyright (C) 2011 RaNaN
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 3 of the License,
#or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#See the GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
###
class Handler:
def __init__(self, cli):
self.cli = cli
self.init()
client = property(lambda self: self.cli.client)
input = property(lambda self: self.cli.input)
def init(self):
pass
def onChar(self, char):
pass
def onBackSpace(self):
pass
def onEnter(self, inp):
pass
def setInput(self, inp=""):
self.cli.setInput(inp)
def backspace(self):
self.cli.setInput(self.input[:-1])
def renderBody(self, line):
""" gets the line where to render output and should return the line number below its content """
return line + 1