8000 update some stuff · pmp-p/raylib-python-ctypes-wasm@d47657b · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit d47657b

Browse files
committed
update some stuff
1 parent 0a976fa commit d47657b

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Dor Shapira
3+
Copyright (c) 2023 Dor Shapira
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

raypyc/__init__.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
# -----------------------------------------
3131

32-
def evaluate_c_type_string_to_ctype_type(c_type_string):
33-
cStringToCtypesString = {
32+
def evaluate_c_type_string_to_ctypes_type(c_type_string):
33+
c_string_to_ctypes_string = {
3434
'bool': ctypes.c_bool, # C type: _Bool Python type: bool (1)
3535
'char': ctypes.c_char, # C type: char Python type: 1-character bytes object
3636
'wchar_t': ctypes.c_wchar, # C type: wchar_t Python type: 1-character string
@@ -68,11 +68,11 @@ def evaluate_c_type_string_to_ctype_type(c_type_string):
6868
array_size = int(c_type_string.split('[')[1][:-1])
6969
type_of_array_without_pointers_string = type_of_array_string.replace('*', '')
7070

71-
if type_of_array_string in cStringToCtypesString: # basic type pointer (int*, char*, float*, ...)
72-
return cStringToCtypesString[type_of_array_string] * array_size
71+
if type_of_array_string in c_string_to_ctypes_string: # basic type pointer (int*, char*, float*, ...)
72+
return c_string_to_ctypes_string[type_of_array_string] * array_size
7373

74-
if type_of_array_without_pointers_string in cStringToCtypesString: # basic type pointer(probably double+ pointer level) (int**, char**, float**, ...)
75-
type_of_array_end = cStringToCtypesString[type_of_array_without_pointers_string]
74+
if type_of_array_without_pointers_string in c_string_to_ctypes_string: # basic type pointer(probably double+ pointer level) (int**, char**, float**, ...)
75+
type_of_array_end = c_string_to_ctypes_string[type_of_array_without_pointers_string]
7676
for i in range(pointer_level):
7777
type_of_array_end = ctypes.POINTER(type_of_array_end)
7878
return type_of_array_end * array_size
@@ -89,22 +89,22 @@ def evaluate_c_type_string_to_ctype_type(c_type_string):
8989
type_of_array_string = c_type_string.split('[')[0]
9090
array_size = int(c_type_string.split('[')[1][:-1])
9191

92-
if type_of_array_string in cStringToCtypesString: # basic type array (int, char, float, ...)
93-
return cStringToCtypesString[type_of_array_string] * array_size
92+
if type_of_array_string in c_string_to_ctypes_string: # basic type array (int, char, float, ...)
93+
return c_string_to_ctypes_string[type_of_array_string] * array_size
9494

9595
if type_of_array_string in raypyc.structures.__structs: # a struct array
9696
return raypyc.structures.__structs[type_of_array_string] * array_size
9797

9898
raise TypeError(f"can wrapped this string, the string: {c_type_string}")
9999

100100
elif pointer_level > 0:
101-
if c_type_string in cStringToCtypesString: # basic type pointer (int**, char*, float*, ...)
102-
return cStringToCtypesString[c_type_string]
101+
if c_type_string in c_string_to_ctypes_string: # basic type pointer (int**, char*, float*, ...)
102+
return c_string_to_ctypes_string[c_type_string]
103103

104104
type_without_pointers_string = c_type_string.replace('*', '')
105105

106-
if type_without_pointers_string in cStringToCtypesString: # basic type pointer(probably double+ pointer level) (int**, char**, float**, ...)
107-
type_of_pointer_end = cStringToCtypesString[type_without_pointers_string]
106+
if type_without_pointers_string in c_string_to_ctypes_string: # basic type pointer(probably double+ pointer level) (int**, char**, float**, ...)
107+
type_of_pointer_end = c_string_to_ctypes_string[type_without_pointers_string]
108108
for i in range(pointer_level):
109109
type_of_pointer_end = ctypes.POINTER(type_of_pointer_end)
110110
return type_of_pointer_end
@@ -117,8 +117,8 @@ def evaluate_c_type_string_to_ctype_type(c_type_string):
117117

118118
raise TypeError(f"can wrapped this string, the string: {c_type_string}")
119119

120-
if c_type_string in cStringToCtypesString: # "regular" value not a pointer or an array
121-
return cStringToCtypesString[c_type_string]
120+
if c_type_string in c_string_to_ctypes_string: # "regular" value not a pointer or an array
121+
return c_string_to_ctypes_string[c_type_string]
122122

123123
if c_type_string in raypyc.structures.__structs: # a struct
124124
return raypyc.structures.__structs[c_type_string]
@@ -168,7 +168,7 @@ def check_for_functions_that_can_wrap(functions_set):
168168
function_param_processed = function_param_processed.split('[')[0]
169169

170170
try:
171-
evaluate_c_type_string_to_ctype_type(function_param["type"])
171+
evaluate_c_type_string_to_ctypes_type(function_param["type"])
172172
except:
173173
do_wrapper_this_function = False
174174

@@ -182,7 +182,7 @@ def check_for_functions_that_can_wrap(functions_set):
182182
function_returnType_processed = function_returnType_processed.split('[')[0]
183183

184184
try:
185-
evaluate_c_type_string_to_ctype_type(function["returnType"])
185+
evaluate_c_type_string_to_ctypes_type(function["returnType"])
186186
except:
187187
do_wrapper_this_function = False
188188

@@ -208,8 +208,8 @@ def wrap_functions_to_ctypes_functions_add_function_to_this_module(functions_to_
208208
if 'params' in function_to_wrap.keys():
209209
for function_param in function_to_wrap['params']:
210210
if function_param['type'] != "...":
211-
function_to_wrap_ctype['parametersTypes'].append(evaluate_c_type_string_to_ctype_type(function_param['type']))
212-
function_to_wrap_ctype['returnType'] = evaluate_c_type_string_to_ctype_type(function_to_wrap['returnType'< 67E6 /span>])
211+
function_to_wrap_ctype['parametersTypes'].append(evaluate_c_type_string_to_ctypes_type(function_param['type']))
212+
function_to_wrap_ctype['returnType'] = evaluate_c_type_string_to_ctypes_type(function_to_wrap['returnType'])
213213

214214
f = wrap_function(function_to_wrap_ctype['name'], function_to_wrap_ctype['parametersTypes'], function_to_wrap_ctype['returnType'])
215215
add_function_to_module(current_module, name_of_function, f)

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ license = MIT License
1111
classifiers =
1212
Programming Language :: Python :: 3
1313
License :: OSI Approved :: MIT License
14-
Operating System :: Microsoft :: Windows :: GNU :: Linux
1514

1615
[options]
1716
packages = find:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
author_email=config.get('metadata', 'author_email'),
2727
classifiers=config.get('metadata', 'classifiers'),
2828
packages=find_packages(),
29-
install_requires= ["setuptools>=42", "wheel", "inflection"],
29+
install_requires= ["setuptools>=42", "wheel"],
3030
package_data={
3131
'raylib': ['raypyc/defines/*', 'raypyc/colors/*', 'raypyc/enums/*', 'raypyc/structures/*', 'raypyc/reasings.py', 'raypyc/__init__.py', 'raypyc/__init__.pyi', 'raypyc/*.json', 'raypyc/*.dll']
3232
}

0 commit comments

Comments
 (0)
0