Skip to content

Commit 3c57fd7

Browse files
committed
not much
1 parent 85245ce commit 3c57fd7

File tree

5 files changed

+26
-28
lines changed

5 files changed

+26
-28
lines changed

.todo.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
# ** d2fprgvv_GetValueValue(d2fctx, D2FP_ALT_STY, "Caution", &val)
1313
# ** returns 1 in the val [OUT] parameter.
1414

15-
# todo:
16-
# ** d2fprgcv_GetConstValue(d2fctx, "ALT_STY", &pnum)
17-
# ** returns D2FP_ALT_STY in the pnum [OUT] parameter.
18-
19-
# todo:
20-
# ** d2fprgcn_GetConstName(d2fctx, D2FP_ALT_STY, &pcname)
21-
# ** returns "ALT_STY" in the pcname [OUT] parameter.
22-
23-
# todo:
24-
# ORA_RETTYPE(d2fstatus) d2fobsp_SetBlobProp( d2fctx *pd2fctx, d2fob *pd2fob, ub2 pnum, dvoid *prp );
25-
26-
# todo:
27-
# d2fobgp_GetBlobProp(ctx, obj, D2FP_PERSIST_CLIENT_INFO, val)
28-
2915
# todo:
3016
# d2fobdu_Duplicate( d2fctx *pd2fctx, d2fob *new_owner, d2fob *pd2fob_src, d2fob **ppd2fob_dst, text *new_name );
3117

pyoracle_forms/context.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ def has_property(generic_object: BaseObject, property_number: int) -> bool:
129129
raise_for_code(result)
130130

131131

132-
def property_type(property_number: int) -> int:
133-
return int(api_function("d2fprgt_GetType", (c_uint,))(property_number))
134-
135-
136132
def setter(function_name: str, setter_type: CTypes) -> Setter:
137133
return handled_api_function(function_name, (c_void_p, c_int, setter_type))
138134

@@ -200,14 +196,6 @@ def query_type(generic_object: Union[BaseObject, c_void_p]) -> int:
200196
)
201197

202198

203-
def object_number(obj_name: str) -> int:
204-
return int(
205-
handled_api_function(
206-
"d2fobgcv_GetConstValue", (c_char_p, c_void_p), return_value_index=1
207-
)(obj_name.encode("utf-8"), c_int()).value
208-
)
209-
210-
211199
GetConstant = Callable[[int], str]
212200

213201

@@ -224,3 +212,15 @@ def _get_constant(constant_property: int) -> str:
224212
object_name: GetConstant = get_constant("d2fobgcn_GetConstName")
225213
property_constant_name: GetConstant = get_constant("d2fprgcn_GetConstName")
226214
property_name: GetConstant = get_constant("d2fprgn_GetName")
215+
216+
217+
def property_type(property_number: int) -> int:
218+
return int(api_function("d2fprgt_GetType", (c_uint,))(property_number))
219+
220+
221+
def object_number(obj_name: str) -> int:
222+
return int(
223+
handled_api_function(
224+
"d2fobgcv_GetConstValue", (c_char_p, c_void_p), return_value_index=1
225+
)(obj_name.encode("utf-8"), c_int()).value
226+
)

pyoracle_forms/forms_objects.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ class Window(GenericObject):
122122
object_type = FormsObjects.window
123123

124124

125+
# todo: this is special, has own create functions in C
125126
@forms_object
126127
class DataSourceArgument(GenericObject):
127128
object_type = FormsObjects.data_source_argument
128129

129130

131+
# todo: this is special, has own create functions in C
130132
@forms_object
131133
class DataSourceColumn(GenericObject):
132134
object_type = FormsObjects.data_source_column

pyoracle_forms/generic_object.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,13 @@ class ValueTypes(enum.IntEnum):
6969

7070

7171
property_getters: Dict[ValueTypes, Tuple[Getter, Callable]] = {
72-
# ValueTypes.UNKNOWN: None,
7372
ValueTypes.BOOLEAN: (get_boolean, lambda x: x),
7473
ValueTypes.NUMBER: (get_number, lambda x: x),
7574
ValueTypes.TEXT: (get_text, lambda x: (x or b"").decode(context.encoding)),
7675
ValueTypes.OBJECT: (get_object, lambda x: x),
7776
}
7877

7978
property_setters: Dict[ValueTypes, Tuple[Setter, Callable]] = {
80-
# ValueTypes.UNKNOWN: None,
8179
ValueTypes.BOOLEAN: (set_boolean, lambda x: x),
8280
ValueTypes.NUMBER: (set_number, lambda x: x),
8381
ValueTypes.TEXT: (set_text, lambda x: x.encode(context.encoding)),

pyoracle_forms/misc.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
from .context import query_type
99
from .generic_object import BaseObject, GenericObject, PropertyTypes
1010

11+
# todo: for the future...
12+
# from .context import get_boolean
13+
# from .context import get_number
14+
# from .context import get_object
15+
# from .context import get_text
16+
# from .context import set_boolean
17+
# from .context import set_number
18+
# from .context import set_object
19+
# from .context import set_text
20+
1121
registered_objects: Dict[str, Type[BaseObject]] = {}
1222

1323

@@ -121,6 +131,8 @@ def add_properties(cls: Type[BaseObject], api_objects: Dict) -> Type[BaseObject]
121131

122132
if prop_name and "(obsolete)" not in prop_name:
123133
setattr(cls, prop_name, attribute)
134+
else:
135+
print(prop_name, property_number)
124136

125137
return cls
126138

0 commit comments

Comments
 (0)