package | current | wanted | latest | dependent |
---|---|---|---|---|
d3 | 3.5.17 | 3.5.17 | 7.4.4 | pycroft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput as fi | |
import logging | |
import re | |
import sys | |
import typing | |
logging.basicConfig( | |
#filename='migrator.log', | |
level=logging.INFO, |
CREATE DOMAIN public.ip_port AS integer
CONSTRAINT ip_port_check CHECK (((VALUE >= 1) AND (VALUE <= 65535)));
CREATE DOMAIN public.ip_protocol AS smallint
CONSTRAINT ip_protocol_check CHECK (((VALUE >= 0) AND (VALUE <= 255)));
Perhaps follow the JSON implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_next_field(buf): | |
"""Parse the buffer to return the next field | |
Each field is of the format `<field length>\x00<field>` | |
""" | |
if buf[:2] == b'\0\0': | |
# Field of length zero | |
return b'', buf[2:] | |
raw_length, rest = buf.split(b'\0', maxsplit=1) | |
length = int.from_bytes(raw_length, byteorder='little') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pylint: disable=all | |
# Original idea: | |
@bp.route("/<int:user_id>/hosts") | |
def user_show_hosts_json(user_id): | |
list_items = [] | |
for user_host in User.q.get(user_id).user_hosts: | |
# … |