Example #1
0
'''handle the requests to get the xml templates'''

import os
import common

from e3.common.utils import project_path

TEMPLATE_FOLDER = os.path.join(os.path.abspath(project_path()), "e3", "msn", "xml templates")

def get(name, *args):
    '''try to get a template from the template folder and return it,
    return None if not found'''

    name = os.path.join(TEMPLATE_FOLDER, name + '.xml')
    if os.access(name, os.R_OK):
        xml = file(name, 'r')
        template = xml.read()
        xml.close()
        return template % tuple([common.escape(x) for x in args])

    return None


Example #2
0
#    the Free Software Foundation; either version 3 of the License, or
#    (at your option) any later version.
#
#    emesene 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 emesene; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

import os
from e3.common.utils import project_path

os.chdir(os.path.abspath(project_path()))

import sys
import glib
import gettext
import optparse
import shutil

import string

import debugger
import logging
log = logging.getLogger('emesene')

import e3
#from e3 import msn
Example #3
0
'''handle the requests to get the xml templates'''

import os
import common

from e3.common.utils import project_path

TEMPLATE_FOLDER = os.path.join(os.path.abspath(project_path()), "e3", "msn",
                               "xml templates")


def get(name, *args):
    '''try to get a template from the template folder and return it,
    return None if not found'''

    name = os.path.join(TEMPLATE_FOLDER, name + '.xml')
    if os.access(name, os.R_OK):
        xml = file(name, 'r')
        template = xml.read()
        xml.close()
        return template % tuple([common.escape(x) for x in args])

    return None