Skip to content

Commit 861ae1a

Browse files
author
César Román
authored
feat(ia): add ApplicationScope class (#82)
Closes: #81
1 parent 332a487 commit 861ae1a

File tree

2 files changed

+91
-2
lines changed

2 files changed

+91
-2
lines changed

src/com/inductiveautomation/ignition/common/model/__init__.py

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__all__ = ["Version"]
1+
__all__ = ["ApplicationScope", "Version"]
22

33
import re
44

@@ -8,6 +8,95 @@
88
from java.lang import IllegalArgumentException, Object, String
99

1010

11+
class ApplicationScope(Object):
12+
ALL = 7
13+
CLIENT = 4
14+
DESIGNER = 2
15+
GATEWAY = 1
16+
NONE = 0
17+
18+
@staticmethod
19+
def getGlobalScope():
20+
# type: () -> int
21+
"""Returns the scope of this jvm, wherever it may be.
22+
23+
Returns:
24+
The scope of this JVM, wherever it may be.
25+
26+
"""
27+
return -1
28+
29+
@staticmethod
30+
def getScopePrefix():
31+
# type: () -> String
32+
"""Returns the current jvm's scope prefix, for use in thread
33+
names.
34+
35+
Returns:
36+
The current JVM's scope prefix, for use in thread names.
37+
"""
38+
return "designer"
39+
40+
@staticmethod
41+
def init(globalScope):
42+
# type: (int) -> None
43+
pass
44+
45+
@staticmethod
46+
def isClient(scope):
47+
# type: (int) -> bool
48+
pass
49+
50+
@staticmethod
51+
def isDesigner(scope):
52+
# type: (int) -> bool
53+
pass
54+
55+
@staticmethod
56+
def isGateway(scope):
57+
# type: (int) -> bool
58+
pass
59+
60+
@staticmethod
61+
def parseScope(s):
62+
# type: (String) -> int
63+
"""Returns a bitmask representing application scope for strings
64+
like:
65+
66+
"C"= client
67+
"DC"= designer or client
68+
"G"= gateway
69+
"N"=none
70+
"A"=all
71+
72+
Args:
73+
s: The scope.
74+
75+
Returns:
76+
The scope's int value.
77+
"""
78+
pass
79+
80+
@staticmethod
81+
def toCode(scope):
82+
# type: (int) -> String
83+
"""Turns a scope int into the various scope codes:
84+
85+
"C"= client
86+
"DC"= designer or client
87+
"G"= gateway
88+
"N"=none
89+
"A"=all
90+
91+
Args:
92+
scope: The scope's int value.
93+
94+
Returns:
95+
The scope code.
96+
"""
97+
pass
98+
99+
11100
class Version(Object):
12101
build = 0 # type: int
13102
dev = True # type: bool

src/java/nio/file/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Generic, Iterator, List, TypeVar, Union
1+
from typing import Any, Iterator, List, TypeVar, Union
22

33
from java.lang import Class, Enum, Object, String
44

0 commit comments

Comments
 (0)