-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding extra tag * Updating pydantic and fixing changelog.md * Refactoring verify_connector_and_id * Fixing formatting * Upload image (#63) * minimal GNS3 version * Added compute image upload method. Co-authored-by: louis-oui <[email protected]> * Upgrading to poetry v1.0 (#67) * Enhancement py38 support (#68) * Updating and fixing envlist in tox * Adding tox-conda requirements and changing image on circleci * Fixing step to install poetry * Adding python 3.8 in classifiers * Enhancement docker dev environment (#69) * Adding devcontainer for vscode standardized testing * Fixing the project close method update and wrap docstring * fixing tests and adding some docs (#72) Co-authored-by: Scott Keiffer <[email protected]> Co-authored-by: louis-oui <[email protected]>
- Loading branch information
1 parent
d1f8e81
commit 9e0ba6d
Showing
13 changed files
with
1,319 additions
and
301 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Inspired from: | ||
# https://github.com/nornir-automation/nornir/blob/develop/Dockerfile | ||
# https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3-miniconda | ||
FROM continuumio/miniconda3 | ||
|
||
WORKDIR /gns3fy | ||
ENV PATH="/root/.poetry/bin:$PATH" \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -yq curl git openssh-client less iproute2 procps iproute2 lsb-release make \ | ||
&& curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python \ | ||
&& poetry config virtualenvs.create false \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY pyproject.toml . | ||
COPY poetry.lock . | ||
|
||
RUN poetry install --no-interaction |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "gns3fy - Miniconda", | ||
"context": "..", | ||
"dockerFile": "Dockerfile", | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/opt/conda/bin/python", | ||
"python.linting.enabled": true, | ||
"python.linting.pylintPath": "/opt/conda/bin/pylint", | ||
"python.formatting.blackPath": "/opt/conda/bin/black", | ||
"python.formatting.provider": "black", | ||
"python.linting.pylintEnabled": false, | ||
"python.linting.flake8Path": "/opt/conda/bin/flake8", | ||
"python.linting.flake8Enabled": true, | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-python.python" | ||
] | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "make docker-settings", | ||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. | ||
// "remoteUser": "vscode" | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
""" | ||
Functions used as helpers for drawing objects in a GNS3 Project. | ||
""" | ||
|
||
|
||
def generate_rectangle_svg( | ||
height: int = 100, | ||
width: int = 200, | ||
fill: str = "#ffffff", | ||
fill_opacity: float = 1.0, | ||
stroke: str = "#000000", | ||
stroke_width: int = 2, | ||
) -> str: | ||
return ( | ||
f'<svg height="{height}" width="{width}"><rect fill="{fill}" fill-opacity="' | ||
f'{fill_opacity}" height="{height}" stroke="{stroke}" stroke-width="' | ||
f'{stroke_width}" width="{width}" /></svg>' | ||
) | ||
|
||
|
||
def generate_ellipse_svg( | ||
height: float = 200.0, | ||
width: float = 200.0, | ||
cx: int = 100, | ||
cy: int = 100, | ||
fill: str = "#ffffff", | ||
fill_opacity: float = 1.0, | ||
rx: int = 100, | ||
ry: int = 100, | ||
stroke: str = "#000000", | ||
stroke_width: int = 2, | ||
) -> str: | ||
return ( | ||
f'<svg height="{height}" width="{width}"><ellipse cx="{cx}" cy="{cy}" fill="' | ||
f'{fill}" fill-opacity="{fill_opacity}" rx="{rx}" ry="{ry}" stroke="{stroke}" ' | ||
f'stroke-width="{stroke_width}" /></svg>' | ||
) | ||
|
||
|
||
def generate_line_svg( | ||
height: int = 0, | ||
width: int = 200, | ||
x1: int = 0, | ||
x2: int = 200, | ||
y1: int = 0, | ||
y2: int = 0, | ||
stroke: str = "#000000", | ||
stroke_width: int = 2, | ||
) -> str: | ||
return ( | ||
f'<svg height="{height}" width="{width}"><line stroke="{stroke}" stroke-width="' | ||
f'{stroke_width}" x1="{x1}" x2="{x2}" y1="{y1}" y2="{y2}" /></svg>' | ||
) | ||
|
||
|
||
def parsed_x(x: int, obj_width: int = 100) -> int: | ||
return x * obj_width | ||
|
||
|
||
def parsed_y(y: int, obj_height: int = 100) -> int: | ||
return (y * obj_height) * -1 |
Oops, something went wrong.