mirror of
https://github.com/GNS3/gns3-registry.git
synced 2024-12-24 06:56:41 +00:00
Merge pull request #20 from GNS3/symbols
Custom symbol support (registry part)
This commit is contained in:
commit
216aece030
@ -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
|
||||
|
@ -12,7 +12,8 @@
|
||||
"maintainer": "GNS3 Team",
|
||||
"maintainer_email": "developers@gns3.net",
|
||||
"usage": "Login is tc. sudo work without password",
|
||||
|
||||
"symbol": "linux_guest.svg",
|
||||
|
||||
"qemu": {
|
||||
"adapter_type": "e1000",
|
||||
"adapters": 1,
|
||||
|
15
check.py
15
check.py
@ -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
11
symbols/README.rst
Normal 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
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
10
symbols/linux_guest.txt
Normal 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
|
Loading…
Reference in New Issue
Block a user