Skip to content

Convert HTML to Image

from html2image import HTML2Image

with HTML2Image('<html><strong>Fooo</strong></html>', width='300') as html:
    image = html.render()
import os
from ast import literal_eval
import tempfile
import subprocess
from flask import Flask, abort, request, Response
from flask.ext.mako import MakoTemplates, render_template
from destral.openerp import OpenERPService
from destral.transaction import Transaction

Checklist

  • Create user replication in the master
sudo -u postgres psql -c "CREATE USER rep REPLICATION \
LOGIN ENCRYPTED PASSWORD 'thepassword';"
  • Modify postgresql.conf in the master
listen_address = # make sure we're listening as appropriate
wal_level = hot_standby
"""
Use ERPPeek or OOOP interface compatible insed OpenERP.
Ex.
client = PoolWrapper(pool, cursor, uid)
client.ResPartner.search([])
partner_obj = client.ResPartner
partner_obj.write([1], {'name': 'Fooo!'})
"""
import logging
import os
import click
from erppeek import Client
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('installer')
def setup_peek(**peek_config):
import os
print "Descarregant PDF comers..."
os.system('curl "http://simel.simel.ree.es/sep/PubServlet2?operacion=AccInfor&fichero=117_Comercializadores.pdf" > comers.pdf')
print "Transformant a TXT..."
os.system('pdftotext comers.pdf')
print "Creant diccionari..."
c = open('comers.txt', 'r').read()
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Credits to: https://gist.github.com/FiloSottile/7634541
"""
import os
import BaseHTTPServer
import sys
import time
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import BaseHTTPServer
import sys
import time
import urlparse
import json
@app.route('/_check_bank/<acc_number>')
def _check_bank(acc_number):
"""Funció AJAX per comprovar el número de compte bancari."""
O = app.config['OOOP']
spain = O.ResCountry.search([('code', '=', 'ES')])[0]
lang = '%s_ES' % get_locale()
vals = O.ResPartnerBank.onchange_banco([], acc_number, spain,
{'lang': lang})
res = {'message': '', 'status': False}
if 'warning' in vals:

Sitecustomize

Fix for unicode can't decode ascii...

Something went wrong with that request. Please try again.