Commits

Guido Draheim  committed 5e72cf9

cleanup

  • Participants
  • Parent commits 7bd548b

Comments (0)

Files changed (1)

File src/dvbcronrecording/core.py

 import os.path
 import time
 import locale
-from urllib import quote_plus, unquote_plus
 
 from trac.core import Component, implements
 # from trac.wiki import wiki_to_html, wiki_to_oneliner
 
 from db.session import db_cnx, commit #@UnresolvedImport
 from db.schema import RecordingList
-import sqlalchemy as _as
 
 def _(text): return text
 
-from db import schema
-def affinity(table_name, column_name):
-    global tables
-    for table in schema.tables:
-        if table.name == table_name:
-            for column in table.columns:
-                if column.name == column_name:
-                    return column.type
-    return None
-def aff(value, table_name, column_name):
-    if value is None: return None
-    typed = affinity(table_name, column_name)
-    if typed in [ "int", "INT", "integer", "INTEGER"]:
-        return intnull(value)
-    return ustr(value)
 def intnull(value, default = None):
     if value is None: return default
     try: return int(value)
     if type(text) is unicode: return text
     if type(text) is str: return unicode(text)
     return unicode(str(text))
-def quote_plus_str(text):
-    if type(text) is unicode: return quote_plus(text.encode("utf-8"))
-    if type(text) is str: return quote_plus(text)
-    return quote_plus(str(text))
-def unquote_plus_ustr(text):
-    return unicode(unquote_plus(text), "utf-8")    
 
 class MakefileEntry: pass
 
                     end = endtime+"+"+extratime
                 else:
                     end = endtime
-                filename = quote_plus_str(check["title"])
+                filename = quote4(check["title"])
                 yield "+%(channel)s %(newtime)s %(end)s %(day)s %(filename)s!" % locals()
             yield "> %s" % xx