Userscript

This commit is contained in:
Ruud
2011-09-28 09:17:34 +02:00
parent c6f322a2c2
commit f09572b662
5 changed files with 41 additions and 67 deletions
+6
View File
@@ -4,6 +4,7 @@ from couchpotato.core.helpers.variable import getExt
from couchpotato.core.logger import CPLog
from couchpotato.environment import Env
from flask.helpers import send_from_directory
from flask.templating import render_template_string
from libs.multipartpost import MultipartPostHandler
from urlparse import urlparse
import cookielib
@@ -40,6 +41,11 @@ class Plugin(object):
def getName(self):
return self.__class__.__name__
def renderTemplate(self, parent_file, template, **params):
template = open(os.path.join(os.path.dirname(parent_file), template), 'r').read()
return render_template_string(template, **params)
def registerStatic(self, plugin_file, add_to_head = True):
# Register plugin path