# -*- coding: utf-8 -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
import ulib.base.i_need_py23

__all__ = ('TextTempl', 'SqlTempl')

from base import FileTempl, register_templ

class TextTempl(FileTempl):
    NAME = ('text', 't')
    EXT = '.txt'

    MODE = u"text"

    def get_lines(self):
        return self.appendtext(None, self.modeline)

class ConfTempl(FileTempl):
    NAME = ('conf', 'c')
    EXT = '.conf'

    MODE = u"conf"

    def get_lines(self):
        return self.appendtext(None, self.modeline)

class SqlTempl(FileTempl):
    NAME = 'sql'
    EXT = '.sql'

    MODE = u"sql"
    MODELINE_PREFIX = u"-- "

    def get_lines(self):
        return self.appendtext(None, self.modeline)

register_templ(TextTempl, ConfTempl, SqlTempl)
