Commit cdce9b24 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Appease Google's Mobile-friendly status on some pages

parent a0f45ecd
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
""" """
asn2dataModel converts ASN.1 modules to a variety of target languages asn2dataModel converts ASN.1 modules to a variety of target languages
""" """
from .asn2dataModel import main
from . import msgPrinter from . import msgPrinter
from . import msgPrinterASN1 from . import msgPrinterASN1
__version__ = 1.0 __version__ = 1.0
...@@ -41,7 +41,7 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir): ...@@ -41,7 +41,7 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
#print "Use ASN1SCC to generate the structures for '%s'" % asnFile #print "Use ASN1SCC to generate the structures for '%s'" % asnFile
asn1SccPath = spawn.find_executable('asn1.exe') asn1SccPath = spawn.find_executable('asn1.exe')
if not asn1SccPath: if not asn1SccPath:
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n") # pragma: no cover panic("ASN1SCC seems to be missing from your system (asn1.exe not found in PATH).\n") # pragma: no cover
os.system( os.system(
("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") + ("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") +
"\"{}\" -wordSize 8 -typePrefix asn1Scc -Ada -uPER -o \"".format(asn1SccPath) + "\"{}\" -wordSize 8 -typePrefix asn1Scc -Ada -uPER -o \"".format(asn1SccPath) +
......
...@@ -40,7 +40,7 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir): ...@@ -40,7 +40,7 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
#print "Use ASN1SCC to generate the structures for '%s'" % asnFile #print "Use ASN1SCC to generate the structures for '%s'" % asnFile
asn1SccPath = spawn.find_executable('asn1.exe') asn1SccPath = spawn.find_executable('asn1.exe')
if not asn1SccPath: if not asn1SccPath:
panic("ASN1SCC seems not installed on your system (asn1.exe not found in PATH).\n") # pragma: no cover panic("ASN1SCC seems to be missing from your system (asn1.exe not found in PATH).\n") # pragma: no cover
os.system( os.system(
("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") + ("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") +
"\"{}\" -wordSize 8 -typePrefix asn1Scc -c -uPER -o \"".format(asn1SccPath) + "\"{}\" -wordSize 8 -typePrefix asn1Scc -c -uPER -o \"".format(asn1SccPath) +
......
...@@ -28,6 +28,8 @@ code generator A.''' ...@@ -28,6 +28,8 @@ code generator A.'''
import os import os
import sys import sys
import re import re
import distutils.spawn as spawn
import commonPy import commonPy
from commonPy.utility import panic, inform from commonPy.utility import panic, inform
from commonPy.asnAST import AsnBool, AsnInt, AsnReal, AsnString, AsnEnumerated, AsnSequence, AsnSet, AsnChoice, AsnMetaMember, AsnSequenceOf, AsnSetOf from commonPy.asnAST import AsnBool, AsnInt, AsnReal, AsnString, AsnEnumerated, AsnSequence, AsnSet, AsnChoice, AsnMetaMember, AsnSequenceOf, AsnSetOf
...@@ -57,13 +59,13 @@ def CleanNameAsSimulinkWants(name): ...@@ -57,13 +59,13 @@ def CleanNameAsSimulinkWants(name):
def OnStartup(unused_modelingLanguage, asnFiles, outputDir): def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
#print "Use ASN1SCC to generate the structures for '%s'" % asnFile #print "Use ASN1SCC to generate the structures for '%s'" % asnFile
if None == os.getenv("ASN1SCC"): asn1SccPath = spawn.find_executable('asn1.exe')
if None == os.getenv("DMT"): # pragma: no cover if not asn1SccPath:
panic("DMT environment variable is not set, you must set it.") # pragma: no cover panic("ASN1SCC seems to be missing from your system (asn1.exe not found in PATH).\n") # pragma: no cover
os.putenv("ASN1SCC", os.getenv("DMT") + os.sep + "asn1scc/asn1.exe") # pragma: no cover
os.system( os.system(
("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") + ("mono " if sys.argv[0].endswith('.py') and sys.platform.startswith('linux') else "") +
"\"$ASN1SCC\" -wordSize 8 -typePrefix asn1Scc -Ada -uPER -o \"" + outputDir + "\" \"" + "\" \"".join(asnFiles) + "\"") "\"{}\" -wordSize 8 -typePrefix asn1Scc -c -uPER -o \"".format(asn1SccPath) +
outputDir + "\" \"" + "\" \"".join(asnFiles) + "\"")
os.system("rm -f \"" + outputDir + "\"/*.adb") os.system("rm -f \"" + outputDir + "\"/*.adb")
global g_bHasStartupRunOnce global g_bHasStartupRunOnce
...@@ -88,11 +90,11 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir): ...@@ -88,11 +90,11 @@ def OnStartup(unused_modelingLanguage, asnFiles, outputDir):
def OnBasic(nodeTypename, node, leafTypeDict): def OnBasic(nodeTypename, node, leafTypeDict):
pass pass # pragma: nocover
def OnSequence(nodeTypename, node, leafTypeDict): def OnSequence(nodeTypename, node, leafTypeDict):
pass pass # pragma: nocover
def OnSet(nodeTypename, node, leafTypeDict): def OnSet(nodeTypename, node, leafTypeDict):
...@@ -100,11 +102,11 @@ def OnSet(nodeTypename, node, leafTypeDict): ...@@ -100,11 +102,11 @@ def OnSet(nodeTypename, node, leafTypeDict):
def OnEnumerated(nodeTypename, node, leafTypeDict): def OnEnumerated(nodeTypename, node, leafTypeDict):
pass pass # pragma: nocover
def OnSequenceOf(nodeTypename, node, leafTypeDict): def OnSequenceOf(nodeTypename, node, leafTypeDict):
pass pass # pragma: nocover
def OnSetOf(nodeTypename, node, leafTypeDict): def OnSetOf(nodeTypename, node, leafTypeDict):
...@@ -112,7 +114,7 @@ def OnSetOf(nodeTypename, node, leafTypeDict): ...@@ -112,7 +114,7 @@ def OnSetOf(nodeTypename, node, leafTypeDict):
def OnChoice(nodeTypename, node, leafTypeDict): def OnChoice(nodeTypename, node, leafTypeDict):
pass pass # pragma: nocover
def OnShutdown(): def OnShutdown():
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
# generated code. # generated code.
# #
import re import re
import commonPy import commonPy
from commonPy.utility import panic, inform from commonPy.utility import panic, inform
from commonPy.asnAST import AsnBool, AsnInt, AsnReal, AsnString, AsnEnumerated, AsnSequence, AsnSet, AsnChoice, AsnMetaMember, AsnSequenceOf, AsnSetOf from commonPy.asnAST import AsnBool, AsnInt, AsnReal, AsnString, AsnEnumerated, AsnSequence, AsnSet, AsnChoice, AsnMetaMember, AsnSequenceOf, AsnSetOf
...@@ -68,11 +69,11 @@ def OnStartup(unused_modelingLanguage, unused_asnFile, outputDir): ...@@ -68,11 +69,11 @@ def OnStartup(unused_modelingLanguage, unused_asnFile, outputDir):
def OnBasic(nodeTypename, node, leafTypeDict): def OnBasic(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnSequence(nodeTypename, node, leafTypeDict): def OnSequence(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnSet(nodeTypename, node, leafTypeDict): def OnSet(nodeTypename, node, leafTypeDict):
...@@ -80,11 +81,11 @@ def OnSet(nodeTypename, node, leafTypeDict): ...@@ -80,11 +81,11 @@ def OnSet(nodeTypename, node, leafTypeDict):
def OnEnumerated(nodeTypename, node, leafTypeDict): def OnEnumerated(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnSequenceOf(nodeTypename, node, leafTypeDict): def OnSequenceOf(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnSetOf(nodeTypename, node, leafTypeDict): def OnSetOf(nodeTypename, node, leafTypeDict):
...@@ -92,7 +93,7 @@ def OnSetOf(nodeTypename, node, leafTypeDict): ...@@ -92,7 +93,7 @@ def OnSetOf(nodeTypename, node, leafTypeDict):
def OnChoice(nodeTypename, node, leafTypeDict): def OnChoice(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnShutdown(): def OnShutdown():
......
...@@ -47,7 +47,7 @@ def OnSequence(nodeTypename, node, leafTypeDict): ...@@ -47,7 +47,7 @@ def OnSequence(nodeTypename, node, leafTypeDict):
def OnSet(nodeTypename, node, leafTypeDict): def OnSet(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnEnumerated(nodeTypename, node, leafTypeDict): def OnEnumerated(nodeTypename, node, leafTypeDict):
...@@ -59,7 +59,7 @@ def OnSequenceOf(nodeTypename, node, leafTypeDict): ...@@ -59,7 +59,7 @@ def OnSequenceOf(nodeTypename, node, leafTypeDict):
def OnSetOf(nodeTypename, node, leafTypeDict): def OnSetOf(nodeTypename, node, leafTypeDict):
pass pass # pragma: no cover
def OnChoice(nodeTypename, node, leafTypeDict): def OnChoice(nodeTypename, node, leafTypeDict):
......
...@@ -103,7 +103,7 @@ def OnStartup(unused_modelingLanguage, asnFile, outputDir): ...@@ -103,7 +103,7 @@ def OnStartup(unused_modelingLanguage, asnFile, outputDir):
inform("Scade612_A_mapper: Creating file '%s'...", outputFilename) inform("Scade612_A_mapper: Creating file '%s'...", outputFilename)
global g_outputFile global g_outputFile
g_outputFile = open(outputDir + outputFilename, 'w') g_outputFile = open(outputDir + outputFilename, 'wb')
global g_mainOid global g_mainOid
g_mainOid = "/" + RandomHex(4) + "/" + RandomHex(3) + "/" g_mainOid = "/" + RandomHex(4) + "/" + RandomHex(3) + "/"
......
This diff is collapsed.
Supports Markdown
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