Merge pull request #20 from GNS3/symbols

Custom symbol support (registry part)
This commit is contained in:
Julien Duponchelle 2015-10-05 09:20:37 +02:00
commit 216aece030
6 changed files with 1961 additions and 3 deletions

View File

@ -5,7 +5,11 @@ GNS3-registry
:target: https://travis-ci.org/GNS3/gns3-registry
This is the GNS3 registry where user can share
appliances configurations.
appliances configurations and symbols.
Add a new symbol
################
Look for examples in the symbols directory.
Add a new appliance

View File

@ -12,6 +12,7 @@
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"usage": "Login is tc. sudo work without password",
"symbol": "linux_guest.svg",
"qemu": {
"adapter_type": "e1000",

View File

@ -18,7 +18,7 @@
import os
import jsonschema
import json
import sys
def check_schema(appliance):
with open('schemas/appliance.json') as f:
@ -29,10 +29,23 @@ def check_schema(appliance):
jsonschema.validate(appliance_json, schema)
def check_symbol(symbol):
licence_file = os.path.join('symbols', symbol.replace('.svg', '.txt'))
if not os.path.exists(licence_file):
print("Missing licence {} for {}".format(licence_file, symbol))
sys.exit(1)
def main():
print("=> Check appliances")
for appliance in os.listdir('appliances'):
print('Check {}'.format(appliance))
check_schema(appliance)
print("=> Check symbols")
for symbol in os.listdir('symbols'):
if symbol.endswith('.svg'):
print('Check {}'.format(symbol))
check_symbol(symbol)
if __name__ == '__main__':
main()

11
symbols/README.rst Normal file
View File

@ -0,0 +1,11 @@
Symbols
*******
This directory contain symbols that you can import in GNS3.
Rules
=====
* All symbols must be provided as a SVG file
* A file named symbol.txt should exist and contain symbol licence
* Try top keep a small file size

1919
symbols/linux_guest.svg Executable file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 63 KiB

10
symbols/linux_guest.txt Normal file
View File

@ -0,0 +1,10 @@
Tux:
https://commons.wikimedia.org/wiki/File:NewTux.svg
(c) Larry Ewing, Simon Budig und Anja Gerwinsk
© The copyright holder of this file, Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.
Attribution: Larry Ewing
This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This work is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See version 2 and version 3 of the GNU General Public License for more details.
Computer Background:
Public Domain Computer from GNS3