Applicable to Odoo XML and JS files. See LICENSE file on for full copyright and licensing details.
The script was applied to the entire odoo codebase and was able to automatically convert most icons in a few seconds.
Applicable to Odoo XML and JS files. See LICENSE file on for full copyright and licensing details.
The script was applied to the entire odoo codebase and was able to automatically convert most icons in a few seconds.
import re | |
from base64 import b64encode | |
specialsre = re.compile(r'[][\\()<>@,:;".]') | |
escapesre = re.compile(r'[\\"]') | |
def formataddr(pair): | |
"""Takes a 2-tuple of the form (realname, email_address) and returns | |
the string value suitable for an RFC 2822 From, To or Cc header. |
""" | |
Simple infix mathematic expression calculator | |
Author: Julien Castiaux (github.com/Julien00859) | |
Licence: MIT | |
""" | |
from operator import add, sub, mul, truediv, mod | |
def shuntingyard(expr): | |
"""Convert infix expression to postfix""" |
from itertools import product, chain, starmap | |
SURFACE = 0b01 | |
SIDE = 0b10 | |
def square(x, y, radius, min_x, min_y, max_x, max_y, mode): | |
""" | |
Coordinates in/on the square center: (x, y), side length: 2 * radius | |
:param x: The center abscissa | |
:param y: The center ordinate |
#!/usr/bin/env python3 | |
from collections.abc import MutableSequence | |
from itertools import zip_longest, chain | |
from io import StringIO | |
from sys import argv | |
def inputint(prompt="", lower_bound=None, upper_bound=None): | |
while True: |
*.pyc | |
__pycache__ |
error.json | |
__pycache__/ |
""" | |
Overpopulation: if a living cell is surrounded by more than three living cells, it dies. | |
Stasis: if a living cell is surrounded by two or three living cells, it survives. | |
Underpopulation: if a living cell is surrounded by fewer than two living cells, it dies. | |
Reproduction: if a dead cell is surrounded by exactly three cells, it becomes a live cell. | |
""" | |
from curses import wrapper, curs_set | |
from math import sqrt | |
from numpy import array, int8, ndenumerate |
"""Wrapper around builtins and itertools to chain calls""" | |
from itertools import * | |
from functools import reduce | |
class Chain: | |
def __init__(self, data): | |
self._data = data | |
# Chain methods |
#!/bin/bash | |
if [ -z $(which python3) ]; then | |
echo "Please install python3" | |
exit 1 | |
fi | |
if [ -z $(which virtualenv) ]; then | |
echo "Please install python-virtualenv" | |
exit 1 |