Commit 6769190a authored by Maxime Perrotin's avatar Maxime Perrotin

Add proper license and update headers

parent 9170d322
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
......@@ -30,4 +30,5 @@ Or with a default value (make sure you use quote):
(c) European Space Agency
Author: Maxime Perrotin
LICENSE: LGPL - see LICENSE file
#!/usr/bin/env python2
# -*- coding:Utf-8 -*-
#!/usr/bin/env python
# -*- coding:utf-8 -*-
''' Custom logging color formatter
When logging, use the following format
[criticality] file - message
the color of [criticality] (warning, info, etc.) is different for each value
Adapted by ESA from examples found on StackOverflow
'''
# Adapted from :
# Brandon Thomson
# http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-output-to-be-colored
import logging
class ColorFormatter( logging.Formatter ):
FORMAT = ( "[%(levelname)-19s] " "$BOLD%(filename)-20s$RESET" "%(message)s" )
# FORMAT = ( "[%(levelname)-18s] " "($BOLD%(filename)s$RESET:%(lineno)d) " "%(message)s" )
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
COLORS = {
'WARNING' : YELLOW,
'INFO' : GREEN,
'DEBUG' : WHITE,
'CRITICAL' : RED,
'ERROR' : RED
}
def __init__( self, use_color ):
self.use_color = use_color
msg = self.formatter_msg( self.FORMAT )
logging.Formatter.__init__( self, msg )
def formatter_msg( self, msg ):
if( self.use_color ):
msg = msg.replace( "$RESET", self.RESET_SEQ ).replace( "$BOLD", self.BOLD_SEQ )
else:
msg = msg.replace( "$RESET", "" ).replace( "$BOLD", "" )
return msg
def format( self, record ):
levelname = record.levelname
if( self.use_color and levelname in self.COLORS ):
fore_color = 30 + self.COLORS[ levelname ]
levelname_color = self.COLOR_SEQ % fore_color + levelname + self.RESET_SEQ
record.levelname = levelname_color
return logging.Formatter.format( self, record )
class ColorFormatter(logging.Formatter):
''' Custom color formatter for shell logging '''
COLORS = {'WARNING' : 33, # yellow
'INFO' : 32, # green
'DEBUG' : 37, # white
'CRITICAL' : 31, # red
'ERROR' : 31}
def __init__(self):
''' Create a custom format for the logging messages '''
fmt = "[%(levelname)-19s] \033[1m%(filename)-20s\033[0m%(message)s"
super(ColorFormatter, self).__init__(fmt)
def format(self, record):
''' When formatting, set the color of the criticality level text '''
col = self.COLORS[record.levelname]
record.levelname = '\033[1m\033[{}m {}\033[0m'.format(col,
record.levelname)
return super(ColorFormatter, self).format(record)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
Handle regression testing scenarios in the context of the MSC recordings
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
from PySide.QtCore import QThread, Signal
#from PySide.QtNetwork import QUdpSocket, QHostAddress
import Queue
import datamodel
import sys
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
QMainWindow widget, handle application termination by saving windows
geometry for the next execution
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
from PySide.QtCore import QSettings, Qt, Signal, Slot
from PySide.QtGui import QMainWindow, QDockWidget, QPushButton
from asn1_value_editor import PLOTTERS, asn1Editor
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
This module offers facilities to edit ASN.1 values using a GUI
It also contains the engine for the TASTE GUI components
Additionally, the tool can be used to simulate TASTE SDL components
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import asn1_value_editor
import gui
import errCode
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
'''
ASN.1 Python support functions
'''
Helper API functions to compare two ASN.1 variables
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
__author__ = "Maxime Perrotin"
__license__ = "ESA Licence for open source software"
__version__ = "0.1"
__url__ = "http://taste.tuxfamily.org"
from vn import fromValueNotationToPySide
def comparePythonValues(a, b):
''' Compare two ASN.1 variables in Python format, ignoring 'Any' fields (translated from '*' in GSER) '''
''' Compare two ASN.1 variables in Python format, ignoring 'Any' fields
(translated from '*' in GSER)
'''
if a == b:
return True
for x in (a, b):
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
'''
ASN.1 Variable editor
'''
Main GUI widget
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
__author__ = "Maxime Perrotin"
__license__ = "ESA Licence for open source software"
__version__ = "1.0"
__license__ = "LGPLv3"
__version__ = "1.0.0"
__url__ = "http://taste.tuxfamily.org"
import sys
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
"""
TASTE ASN.1 Value Editor
This module extracts the error code and corresponding message from
the files generated by ASN1SCC. Used by the ASN.1 Value editor to
report meaningful error messages in case of type constraint violation
'''
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import re
import sys
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
# ASN.1 Variable editor
Tool main entry point (when used standalone)
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
__author__ = "Maxime Perrotin"
__license__ = "ESA Community (compatible with LGPLv3)"
__version__ = "1.0"
__url__ = "http://taste.tuxfamily.org"
# maxime.perrotin@esa.int
import os
import traceback
......@@ -414,9 +422,6 @@ def gui():
button.clicked.connect(editor.loadTC)
elif button.objectName() == 'sendButton':
button.clicked.connect(editor.sendTC)
# if sdl:
# button.clicked.connect(partial(sdl.on_event,
# tc_name=editor.objectName(), param=editor))
# Create a thread to poll the message queue or open an UDP socket
if msgQ:
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
Interface to the TASTE MSC Viewer
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import os
import sys
import subprocess
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
TASTE MSC Streaming Scene
http://taste.tuxfamily.org/
This file is part of TASTE MSC Editor.
TASTE Msc Diagram Editor 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 3 of the License, or
(at your option) any later version.
TASTE ASN.1 Value Editor - MSC Streaming Scene
TASTE Msc Diagram Editor 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 the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TASTE Msc Diagram Editor. If not, see
<http://www.gnu.org/licenses/>.
This module was partly developed in the scope of the TASTE MSC Editor
Author: Angel Esquinas <aesquina@datsi.fi.upm.es>
Maintained by: Maxime Perrotin <maxime.perrotin@esa.int>
Copyright (c) 2012-2015 European Space Agency
Copyright (c) 2012-2015 UPM and European Space Agency
License is LGPL
'''
from PySide.QtCore import Slot
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
Handle Matplotlib and Speedometer widgets
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import os
import time
import signal
......@@ -8,10 +21,6 @@ from tasteplot import TastePlot
from PySide.QtGui import QAction
'''
Library handling Plot (with matplotlib) and Speedometers
'''
class plot:
def __init__(self, handle):
......@@ -40,7 +49,8 @@ class PlotManager:
self._use_gnuplot = False
self.log = log
def newPlot(self, scrollingLimit=50, yAuto=True, xShowAll=False, yMin=-1, yMax=1, saveCsv=False, csvFile='', savePng=False, pngFile=''):
def newPlot(self, scrollingLimit=50, yAuto=True, xShowAll=False, yMin=-1,
yMax=1, saveCsv=False, csvFile='', savePng=False, pngFile=''):
''' Create a plot - supports gnuplot and matplotlib '''
self.plotCount += 1
handle = self.plotCount
......
......@@ -3,7 +3,7 @@
# pylint: disable=C0302
"""
TASTE GUI - SDL Statechart handler
ASN.1 Value Editor - SDL Statechart handler
Connect to OpenGEODE to drive a simulation using the ASN.1 Editor
Display the statechart during the simulation
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
'''
PySide widget that opens an ASN.1 variable editor
and returns a GSER string when done
From taste misc/asn1-value-editor directory the tool
can be tested with this command line:
Example of use from the command line:
./standalone_editor.py -a test/TPos.asn -t T-POS \
-d 'myIntSet: { data4 -1310720, data1 0, data3 -1024, data2 -100.0 }'
The SingleValueEditor widget can also be embedded in another Qt application
This version needs asn1scc version 3
'''
This version needs ASN.1 version 3.x.x
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import subprocess
import signal
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
Interface to matplotlib
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
import sys
import os
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TASTE ASN.1 Value Editor
UDP interface for the TASTE GUIs
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
from PySide.QtGui import QApplication
from PySide.QtNetwork import QUdpSocket, QHostAddress
......
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ASN.1 Value Editor - Value Notation parser and converter
This module contains two functions:
1) fromValueNotationToPySide(varName, string)
Parse a string containing an ASN.1 value expressed in GSER
(also called ASN.1 Value Notation) and return a Python structure that
is compatible with the widget of the ASN.1 Value Editor
Copyright (c) 2012-2015 European Space Agency
2) toASN1ValueNotation(val)
Does the reverse (from Qt widget to ASN.1 Value Notation/GSER)
Copyright (c) 2012-2015 European Space Agency
Designed and implemented by Maxime Perrotin
Contact: maxime.perrotin@esa.int
License is LGPLv3 - Check the LICENSE file
"""
from pyparsing import(Word, QuotedString, Literal, Combine, Optional,
oneOf, OneOrMore, srange, nums, nestedExpr, Forward,
......@@ -14,7 +39,6 @@ BitStringLiteral = ('"' + Word("01") + '"B').setResultsName('BITSTRING')
OctetStringLiteral=('"' + Word(string.hexdigits) + '"H').setResultsName('OCTETSTRING')
# QuotedString's first parameter = quote type..+multiline to support \n => OK
# (to be checked if this is equivalent to '"' ( options {greedy=false;} : .)* '"' ; in antlr
# Support embedded quotes as per GSER standard (""embedded quoted text"")
StringLiteral = QuotedString('"', escQuote='""', multiline=True,).setResultsName('QUOTEDSTRING')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment