Skip to content

Instantly share code, notes, and snippets.

from trytond.model import fields
from trytond.pool import PoolMeta
__all__ = ['Country']
class Country(metaclass=PoolMeta):
__name__ = 'country.country'
0) Prepare a clean environment
python -m venv pyivenv
cd pyivenv
source ./bin/activate # Posix bash/zsh
.\Scripts\activate.bat # Windows cmd.exe
.\Scripts\Activate.ps1 # Windows PowerShell
pip install -U pip # upgrade pip
@htgoebel
htgoebel / modulegraph-recursive.dot
Created February 21, 2017 17:41
modulegraph call-graph as of PyInstaller v3.2.1
digraph G {
graph [rankdir="TB"];
_ast_names [label="_ast_names", style="filled", fillcolor="#CCFFCCB2", fontcolor="#000000", group="1"];
ModuleGraph___safe_import_hook [label="_safe_import_hook", style="filled", fillcolor="#99FF99B2", fontcolor="#000000", group="1"];
ModuleGraph___determine_parent [label="_determine_parent", style="filled", fillcolor="#99FF99B2", fontcolor="#000000", group="1"];
ModuleGraph___safe_import_module [label="_safe_import_module", style="filled", fillcolor="#99FF99B2", fontcolor="#000000", group="1"];
ModuleGraph__add_module [label="add_module", style="filled", fillcolor="#99FF99B2", fontcolor="#000000", group="1"];
ModuleGraph__findNode [label="findNode", style="filled", fillcolor="#99FF99B2", fontcolor="#000000", group="1"];
ModuleGraph___load_package [label="_load_package", style="filled", fillcolor="#99FF99B2", fontcolor="#000000", group="1"];
ModuleGraph___scan_bytecode [label="_scan_bytecode", style="filled", fillcolor="#99FF99B2", fontcolo
@htgoebel
htgoebel / git-read-tree1.txt
Last active February 20, 2022 11:41
Playing with git read-tree
mkdir modulegraph
cd modulegraph/
rm -rf * .hg* .git*
hg clone https://pyinstaller@bitbucket.org/ronaldoussoren/modulegraph .
hg checkout modulegraph-0.12
rm -rf .git*
git init .
git add .hg/hgrc
cat > .gitignore <<EOF
@htgoebel
htgoebel / test_pyzmq.py
Last active August 29, 2015 14:13
Minimal example for pyzmq, usable as test-case.
import threading
import uuid
import time
import zmq
def sender(send_addr, receiver_port):
send_socket = ctx.socket(zmq.REQ)
address = "tcp://{addr}:{port}".format(addr=send_addr, port=receiver_port)
@htgoebel
htgoebel / .gitignore
Last active August 29, 2015 14:11
PyInstaller #653: Importing nested modules from eggs/*.egg
/bin
/lib
/lib64
/include
build/
dist/
*.egg-info
*.py[co]
@htgoebel
htgoebel / diff-filter.py
Created July 6, 2012 10:57
Filter all unchanged and all only-comment lines from a diff-output.
#!/usr/bin/python
"""
Filter all unchanged and all only-comment lines from a diff-output.
and be more terse.
"""
import sys
import re