예제 #1
0
 def get_command(self):
     try:
         if os.name == 'nt':
             lessc = misc.find_in_path('lessc.cmd')
         else:
             lessc = misc.find_in_path('lessc')
     except IOError:
         lessc = 'lessc'
     lesspath = get_resource_path('web', 'static', 'lib', 'bootstrap', 'less')
     return [lessc, '-', '--clean-css', '--no-js', '--no-color', '--include-path=%s' % lesspath]
예제 #2
0
 def get_command(self):
     try:
         if os.name == 'nt':
             lessc = misc.find_in_path('lessc.cmd')
         else:
             lessc = misc.find_in_path('lessc')
     except IOError:
         lessc = 'lessc'
     lesspath = get_resource_path('web', 'static', 'lib', 'bootstrap',
                                  'less')
     return [
         lessc, '-', '--no-js', '--no-color',
         '--include-path=%s' % lesspath
     ]
예제 #3
0
    def dump_pgbadger(self, dir_dump, output, cursor):
        pgbadger = find_in_path("pgbadger")
        if not pgbadger:
            _logger.error("Pgbadger not found")
            return
        filename = os.path.join(dir_dump, output)
        pg_version = dump_db_manifest(cursor)['pg_version']
        log_path = os.environ.get('PG_LOG_PATH', DFTL_LOG_PATH % pg_version)
        if not os.path.exists(os.path.dirname(filename)):
            try:
                os.makedirs(os.path.dirname(filename))
            except OSError as exc:
                # error is different than File exists
                if exc.errno != errno.EEXIST:
                    _logger.error("File can be created")
                    return
        _logger.info("Generating PG Badger report.")
        exclude_query = self.get_exclude_query()
        dbname = cursor.dbname
        command = [
            pgbadger, '-f', 'stderr', '-T', 'Odoo-Profiler', '-o', '-', '-d',
            dbname, '-b', ProfilerController.begin_date, '-e',
            ProfilerController.end_date, '--sample', '2', '--disable-type',
            '--disable-error', '--disable-hourly', '--disable-session',
            '--disable-connection', '--disable-temporary', '--quiet'
        ]
        command.extend(exclude_query)
        command.append(log_path)

        _logger.info("Pgbadger Command:")
        _logger.info(command)
        result = tools.exec_command_pipe(*command)
        with open(filename, 'w') as fw:
            fw.write(result[1].read())
        _logger.info("Done")
예제 #4
0
 def get_command(self):
     try:
         sass = misc.find_in_path('sass')
     except IOError:
         sass = 'sass'
     return [sass, '--stdin', '-t', 'compressed', '--unix-newlines', '--compass',
             '-r', 'bootstrap-sass']
예제 #5
0
 def get_command(self):
     try:
         sass = misc.find_in_path('sass')
     except IOError:
         sass = 'sass'
     return [
         sass, '--stdin', '-t', 'compressed', '--unix-newlines',
         '--compass', '-r', 'bootstrap-sass'
     ]
예제 #6
0
def _get_wkhtmltopdf_bin():
    wkhtmltopdf_bin = find_in_path('wkhtmltopdf')
    if wkhtmltopdf_bin is None:
        raise IOError
    return wkhtmltopdf_bin
예제 #7
0
def _get_wkhtmltopdf_bin():
    return find_in_path('wkhtmltopdf')
예제 #8
0
파일: report.py 프로젝트: Antiun/odoo
def _get_wkhtmltopdf_bin():
    return find_in_path('wkhtmltopdf')
예제 #9
0
def _get_wkhtmltopdf_bin():
    wkhtmltopdf_bin = find_in_path('wkhtmltopdf')
    if wkhtmltopdf_bin is None:
        raise IOError
    return wkhtmltopdf_bin