Пример #1
0
 def get_command(self):
     defpath = os.environ.get("PATH", os.defpath).split(os.pathsep)
     if os.name == "nt":
         lessc = which("lessc.cmd", path=os.pathsep.join(defpath))
     else:
         lessc = which("lessc", path=os.pathsep.join(defpath))
     webpath = openerp.http.addons_manifest["web"]["addons_path"]
     lesspath = os.path.join(webpath, "web", "static", "lib", "bootstrap", "less")
     return [lessc, "-", "--clean-css", "--no-js", "--no-color", "--include-path=%s" % lesspath]
Пример #2
0
 def get_command(self):
     defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
     if os.name == 'nt':
         lessc = which('lessc.cmd', path=os.pathsep.join(defpath))
     else:
         lessc = which('lessc', path=os.pathsep.join(defpath))
     webpath = openerp.http.addons_manifest['web']['addons_path']
     lesspath = os.path.join(webpath, 'web', 'static', 'lib', 'bootstrap', 'less')
     return [lessc, '-', '--clean-css', '--no-js', '--no-color', '--include-path=%s' % lesspath]
Пример #3
0
 def get_command(self):
     defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
     if os.name == 'nt':
         lessc = which('lessc.cmd', path=os.pathsep.join(defpath))
     else:
         lessc = which('lessc', path=os.pathsep.join(defpath))
     webpath = openerp.http.addons_manifest['web']['addons_path']
     lesspath = os.path.join(webpath, 'web', 'static', 'lib', 'bootstrap', 'less')
     return [lessc, '-', '--clean-css', '--no-js', '--no-color', '--include-path=%s' % lesspath]
Пример #4
0
    def get_lib(self, cursor, uid):
        """Return the lib wkhtml path"""
        proxy = self.pool['ir.config_parameter']
        webkit_path = proxy.get_param(cursor, uid, 'webkit_path')

        if not webkit_path:
            try:
                defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
                if hasattr(sys, 'frozen'):
                    defpath.append(os.getcwd())
                    if tools.config['root_path']:
                        defpath.append(os.path.dirname(tools.config['root_path']))
                webkit_path = tools.which('wkhtmltopdf', path=os.pathsep.join(defpath))
            except IOError:
                webkit_path = None

        if webkit_path:
            return webkit_path

        raise UserError(_('Wkhtmltopdf library path is not set') + ' ' +
                            _('Please install executable on your system'
                            ' (sudo apt-get install wkhtmltopdf) or download it from here:'
                            ' http://code.google.com/p/wkhtmltopdf/downloads/list and set the'
                            ' path in the ir.config_parameter with the webkit_path key.'
                            'Minimal version is 0.9.9'))
Пример #5
0
 def get_command(self):
     defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
     sass = which('sass', path=os.pathsep.join(defpath))
     return [
         sass, '--stdin', '-t', 'compressed', '--unix-newlines',
         '--compass', '-r', 'bootstrap-sass'
     ]
Пример #6
0
    def get_lib(self, cursor, uid):
        """Return the lib wkhtml path"""
        proxy = self.pool.get('ir.config_parameter')
        webkit_path = proxy.get_param(cursor, uid, 'webkit_path')

        if not webkit_path:
            try:
                defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
                if hasattr(sys, 'frozen'):
                    defpath.append(os.getcwd())
                    if tools.config['root_path']:
                        defpath.append(os.path.dirname(tools.config['root_path']))
                webkit_path = tools.which('wkhtmltopdf', path=os.pathsep.join(defpath))
            except IOError:
                webkit_path = None

        if webkit_path:
            return webkit_path

        raise except_osv(
                         _('Wkhtmltopdf library path is not set'),
                         _('Please install executable on your system' \
                         ' (sudo apt-get install wkhtmltopdf) or download it from here:' \
                         ' http://code.google.com/p/wkhtmltopdf/downloads/list and set the' \
                         ' path in the ir.config_parameter with the webkit_path key.' \
                         'Minimal version is 0.9.9')
                        )
Пример #7
0
    def get_lib(self, cursor, uid):
        """Return the lib wkhtml path"""
        proxy = self.pool["ir.config_parameter"]
        webkit_path = proxy.get_param(cursor, SUPERUSER_ID, "webkit_path")

        if not webkit_path:
            try:
                defpath = os.environ.get("PATH", os.defpath).split(os.pathsep)
                if hasattr(sys, "frozen"):
                    defpath.append(os.getcwd())
                    if tools.config["root_path"]:
                        defpath.append(os.path.dirname(tools.config["root_path"]))
                webkit_path = tools.which("wkhtmltopdf", path=os.pathsep.join(defpath))
            except IOError:
                webkit_path = None

        if webkit_path:
            return webkit_path

        raise except_osv(
            _("Wkhtmltopdf library path is not set"),
            _(
                "Please install executable on your system"
                " (sudo apt-get install wkhtmltopdf) or download it from here:"
                " http://code.google.com/p/wkhtmltopdf/downloads/list and set the"
                " path in the ir.config_parameter with the webkit_path key."
                "Minimal version is 0.9.9"
            ),
        )
Пример #8
0
    def get_lib(self, cursor, uid):
        """Return the emacs path"""
        proxy = self.pool.get('ir.config_parameter')
        emacs_path = proxy.get_param(cursor, uid, 'emacs_path')

        if not emacs_path:
            try:
                defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
                if hasattr(sys, 'frozen'):
                    defpath.append(os.getcwd())
                    if tools.config['root_path']:
                        defpath.append(
                            os.path.dirname(tools.config['root_path']))
                emacs_path = tools.which('emacs',
                                         path=os.pathsep.join(defpath))
            except IOError:
                emacs_path = None

        if emacs_path:
            return emacs_path

        raise osv.except_osv(
                         _('emacs executable path is not set'),
                         _('Please install executable on your system' \
                         ' (sudo apt-get install emacs24)')
                        )
    def get_lib(self, cursor, uid):
        """Return the pdflatex path"""
        proxy = self.pool.get('ir.config_parameter')
        pdflatex_path = proxy.get_param(cursor, uid, 'pdflatex_path')

        if not pdflatex_path:
            try:
                defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
                if hasattr(sys, 'frozen'):
                    defpath.append(os.getcwd())
                    if tools.config['root_path']:
                        defpath.append(os.path.dirname(tools.config['root_path']))
                pdflatex_path = tools.which('pdflatex', path=os.pathsep.join(defpath))
            except IOError:
                pdflatex_path = None

        if pdflatex_path:
            return pdflatex_path

        raise osv.except_osv(
                         _('pdflatex executable path is not set'),
                         _('Please install executable on your system' \
                         ' (sudo apt-get install texlive-latex-base)')
                        )
Пример #10
0
 def get_command(self):
     defpath = os.environ.get("PATH", os.defpath).split(os.pathsep)
     sass = which("sass", path=os.pathsep.join(defpath))
     return [sass, "--stdin", "-t", "compressed", "--unix-newlines", "--compass", "-r", "bootstrap-sass"]
Пример #11
0
def _get_wkhtmltopdf_bin():
    defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
    return which('wkhtmltopdf', path=os.pathsep.join(defpath))
Пример #12
0
def _get_wkhtmltopdf_bin():
    defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
    return which('wkhtmltopdf', path=os.pathsep.join(defpath))
Пример #13
0
 def get_command(self):
     defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
     sass = which('sass', path=os.pathsep.join(defpath))
     return [sass, '--stdin', '-t', 'compressed', '--unix-newlines', '--compass',
             '-r', 'bootstrap-sass']