Skip to content
View rtempfile.py
class TempFile(object):
def __init__(self, *args, **kwargs):
self.file = open(*args, **kwargs)
def __enter__(self):
return self.file
def __exit__(self, exc_type, exc_val, exc_tb):
self.file.close()
os.remove(self.file.name)
View report.py
from erppeek import Client
import sys
import base64
from subprocess import call
import time
report = 'xml_report_name'
ids = [object_id]
View version.py
def get_version():
import os
import subprocess
try:
try:
version = subprocess.check_output([
'git', 'describe', '--tags'
]).strip()
except subprocess.CalledProcessError:
version = __import__('pkg_resources') \
View README.rst

Convert HTML to Image

from html2image import HTML2Image

with HTML2Image('<html><strong>Fooo</strong></html>', width='300') as html:
    image = html.render()
View report_server.py
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
View README.md

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
View poolwraper.py
"""
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!'})
"""
View install.py
import logging
import os
import click
from erppeek import Client
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('installer')
def setup_peek(**peek_config):
View parse_comers.py
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()
View HookHandler.py
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Credits to: https://gist.github.com/FiloSottile/7634541
"""
import os
import BaseHTTPServer
import sys
import time
Something went wrong with that request. Please try again.