Skip to content

Commit 0df838f

Browse files
committed
* ISysML (initialize): Added. Set "file.encoding" system property to "UTF-8" and construct SysMLKernel.
(main): Do not construct SysMLKernel() here. * SysMLKernel (getMatics): Added.
1 parent 120e12f commit 0df838f

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/ISysML.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,18 @@ public class ISysML {
3535

3636
private static volatile SysMLKernel kernel;
3737

38+
public static void initialize() {
39+
System.setProperty("file.encoding", "UTF-8");
40+
kernel = new SysMLKernel();
41+
}
42+
3843
public static void main(String[] args) throws Exception {
3944
if (args.length < 1) {
4045
throw new IllegalArgumentException("Missing connection file argument");
4146
}
4247

48+
initialize();
49+
4350
Path connectionFile = Paths.get(args[0]);
4451

4552
if (!Files.isRegularFile(connectionFile))
@@ -52,8 +59,6 @@ public static void main(String[] args) throws Exception {
5259
KernelConnectionProperties connProps = KernelConnectionProperties.parse(contents);
5360
JupyterConnection connection = new JupyterConnection(connProps);
5461

55-
56-
kernel = new SysMLKernel();
5762
kernel.becomeHandlerForConnection(connection);
5863

5964
connection.connect();

org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public class SysMLKernel extends BaseKernel {
4545
private final Magics magics;
4646
private final MyMagicParser magicParser;
4747

48+
public Magics getMagics() {
49+
return magics;
50+
}
51+
4852
public SysMLKernel() {
4953
this.interactive = SysMLInteractive.getInstance();
5054
Optional<String> libraryPath = Optional.ofNullable(System.getenv(ISysML.LIBRARY_PATH_KEY));

0 commit comments

Comments
 (0)