retracesoftware-proxy 0.2.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. retracesoftware/__init__.py +0 -0
  2. retracesoftware/__main__.py +288 -0
  3. retracesoftware/autoenable.py +53 -0
  4. retracesoftware/config.json +175 -0
  5. retracesoftware/config.yaml +0 -0
  6. retracesoftware/install/__init__.py +0 -0
  7. retracesoftware/install/config.py +59 -0
  8. retracesoftware/install/edgecases.py +250 -0
  9. retracesoftware/install/globals.py +17 -0
  10. retracesoftware/install/install.py +142 -0
  11. retracesoftware/install/patcher.py +122 -0
  12. retracesoftware/install/patchfindspec.py +117 -0
  13. retracesoftware/install/phases.py +338 -0
  14. retracesoftware/install/predicate.py +92 -0
  15. retracesoftware/install/record.py +174 -0
  16. retracesoftware/install/references.py +66 -0
  17. retracesoftware/install/replace.py +28 -0
  18. retracesoftware/install/replay.py +102 -0
  19. retracesoftware/install/tracer.py +284 -0
  20. retracesoftware/install/typeutils.py +92 -0
  21. retracesoftware/modules.toml +388 -0
  22. retracesoftware/preload.txt +218 -0
  23. retracesoftware/proxy/__init__.py +3 -0
  24. retracesoftware/proxy/gateway.py +49 -0
  25. retracesoftware/proxy/globalref.py +31 -0
  26. retracesoftware/proxy/messagestream.py +204 -0
  27. retracesoftware/proxy/proxyfactory.py +357 -0
  28. retracesoftware/proxy/proxysystem.py +454 -0
  29. retracesoftware/proxy/proxytype.py +424 -0
  30. retracesoftware/proxy/record.py +211 -0
  31. retracesoftware/proxy/replay.py +138 -0
  32. retracesoftware/proxy/serializer.py +28 -0
  33. retracesoftware/proxy/startthread.py +40 -0
  34. retracesoftware/proxy/stubfactory.py +195 -0
  35. retracesoftware/proxy/thread.py +106 -0
  36. retracesoftware/replay.py +104 -0
  37. retracesoftware/run.py +378 -0
  38. retracesoftware/stackdifference.py +133 -0
  39. retracesoftware_proxy-0.2.11.dist-info/METADATA +8 -0
  40. retracesoftware_proxy-0.2.11.dist-info/RECORD +42 -0
  41. retracesoftware_proxy-0.2.11.dist-info/WHEEL +5 -0
  42. retracesoftware_proxy-0.2.11.dist-info/top_level.txt +1 -0
@@ -0,0 +1,388 @@
1
+ [_frozen_importlib_external]
2
+ # "_frozen_importlib_external": {
3
+ # "comment": {
4
+ # "with_state": {
5
+ # "disabled": ["_path_stat"]
6
+ # }
7
+ # }
8
+ # },
9
+
10
+ # "_imp": {
11
+ # "patch_extension_exec": ["exec_dynamic", "exec_builtin"],
12
+ # "comment": {
13
+ # "with_state": {
14
+ # "internal": ["create_dynamic"]
15
+ # }
16
+ # }
17
+ # },
18
+
19
+ [bdb.type_attributes]
20
+ Bdb.disable = ["trace_dispatch"]
21
+
22
+ [pydevd.type_attributes]
23
+ PyDB.disable = ["enable_tracing", "set_suspend", "do_wait_suspend"]
24
+
25
+ ["_pydevd_bundle.pydevd_trace_dispatch_regular".type_attributes]
26
+ ThreadTracer.disable = ["__call__"]
27
+
28
+ ["_pydevd_bundle.pydevd_cython".type_attributes]
29
+ ThreadTracer.disable = ["__call__"]
30
+
31
+
32
+ [sys]
33
+ disable = ["excepthook"]
34
+
35
+ # [importlib]
36
+ # disable = "import_module"
37
+
38
+ # "importlib._bootstrap": {
39
+ # "comment": {
40
+ # "with_state": {
41
+ # "internal": [
42
+ # "_load_unlocked",
43
+ # "_find_spec",
44
+ # "_lock_unlock_module",
45
+ # "_get_module_lock"]
46
+ # }
47
+ # }
48
+ # },
49
+
50
+ [encodings]
51
+ disable = ["search_function"]
52
+
53
+ [enum]
54
+ immutable = ["Enum"]
55
+
56
+ [os]
57
+ immutable = ["stat_result", "terminal_size", "statvfs_result"]
58
+
59
+ # "mmap": {
60
+ # "proxy": [
61
+ # "mmapXXX"
62
+ # ]
63
+ # },
64
+
65
+ [types]
66
+ patch_hash = ["FunctionType"]
67
+ immutable = ["TracebackType", "ModuleType"]
68
+
69
+ [builtins]
70
+ patch_hash = ["object"]
71
+ disable = ["print"]
72
+ immutable = ["BaseException", "memoryview", "int", "float", "complex", "str", "bytes", "bool", "bytearray",
73
+ "type", "slice"]
74
+
75
+ [_thread]
76
+ proxy = ["allocate", "allocate_lock", "RLock"]
77
+
78
+ [_datetime]
79
+ immutable = ["datetime", "tzinfo", "timezone"]
80
+
81
+ [_datetime.type_attributes]
82
+ datetime.proxy = ["now", "utcnow", "today"]
83
+
84
+ [time]
85
+ immutable = ["struct_time"]
86
+ proxy = ["perf_counter", "time", "gmtime", "localtime", "monotonic", "monotonic_ns", "time_ns"]
87
+
88
+ # "io": {
89
+ # "comment": {
90
+ # "proxy": ["open_code", "open"]
91
+ # },
92
+ # "path_predicates": {
93
+ # "open_code": "path",
94
+ # "open": "file"
95
+ # },
96
+ # "patchtype": {
97
+ # "FileIO": {
98
+ # "readinfo": "retracesoftware.install.edgecases.readinto"
99
+ # },
100
+ # "BufferedReader": {
101
+ # "readinfo": "retracesoftware.install.edgecases.readinto"
102
+ # },
103
+ # "BufferedRandom": {
104
+ # "readinfo": "retracesoftware.install.edgecases.readinto"
105
+ # }
106
+ # }
107
+ # },
108
+
109
+ [pathlib]
110
+ immutable = ["PosixPath"]
111
+
112
+ [posix]
113
+ immutable = ["times_result", "statvfs_result", "uname_result", "stat_result", "terminal_size"]
114
+ # ignore = ["fork", "register_at_fork", "basename", "readlink", "strerror", "listdir", "_path_normpath", "DirEntry"]
115
+ # default = "try_proxy"
116
+
117
+ proxy = [
118
+ "_exit", # Function. Exits the process immediately, bypassing cleanup.
119
+ "_fcopyfile", # Function. Low-level file copying (used in shutil).
120
+ "abort", # Function. Sends SIGABRT to terminate the process.
121
+ "access", # Function. Checks file permissions (os.access).
122
+ "chdir", # Function. Changes the current working directory (os.chdir).
123
+ "chflags", # Function. Sets file flags (Unix-specific).
124
+ "chmod", # Function. Changes file permissions (os.chmod).
125
+ "chown", # Function. Changes file ownership (os.chown).
126
+ "chroot", # Function. Changes the root directory for the process.
127
+ "close", # Function. Closes a file descriptor (os.close).
128
+ "closerange", # Function. Closes a range of file descriptors.
129
+ "confstr", # Function. Gets configuration string values (os.confstr).
130
+ "cpu_count", # Function. Returns the number of CPUs (os.cpu_count).
131
+ "ctermid", # Function. Returns the filename for the controlling terminal.
132
+ "device_encoding", # Function. Returns encoding for a file descriptor.
133
+ "dup", # Function. Duplicates a file descriptor (os.dup).
134
+ "dup2", # Function. Duplicates a file descriptor to a specific value (os.dup2).
135
+ "execv", # Function. Executes a program with a path and arguments (os.execv).
136
+ "execve", # Function. Executes a program with environment variables (os.execve).
137
+ "fchdir", # Function. Changes directory using a file descriptor.
138
+ "fchmod", # Function. Changes permissions of a file descriptor.
139
+ "fchown", # Function. Changes ownership of a file descriptor.
140
+ "fork", # Function. Creates a child process (os.fork).
141
+ "forkpty", # Function. Creates a child process with a pseudo-terminal.
142
+ "fpathconf", # Function. Gets configuration values for a file descriptor (os.fpathconf).
143
+ "fspath", # Function. Converts a path-like object to a string or bytes (os.fspath).
144
+ "fstat", # Function. Gets file status for a file descriptor (os.fstat).
145
+ "fstatvfs", # Function. Gets filesystem information for a file descriptor.
146
+ "fsync", # Function. Synchronizes file contents to disk (os.fsync).
147
+ "ftruncate", # Function. Truncates a file descriptor to a specified length.
148
+ "get_blocking", # Function. Checks if a file descriptor is in blocking mode.
149
+ "get_inheritable", # Function. Checks if a file descriptor is inheritable.
150
+ "get_terminal_size", # Function. Returns terminal size (os.get_terminal_size).
151
+ "getcwd", # Function. Gets the current working directory (os.getcwd).
152
+ "getcwdb", # Function. Gets the current working directory as bytes.
153
+ "getegid", # Function. Gets the effective group ID (os.getegid).
154
+ "geteuid", # Function. Gets the effective user ID (os.geteuid).
155
+ "getgid", # Function. Gets the group ID (os.getgid).
156
+ "getgrouplist", # Function. Gets the list of groups for a user.
157
+ "getgroups", # Function. Gets the list of supplementary group IDs.
158
+ "getloadavg", # Function. Returns system load averages (os.getloadavg).
159
+ "getlogin", # Function. Gets the name of the logged-in user (os.getlogin).
160
+ "getpgid", # Function. Gets the process group ID for a process.
161
+ "getpgrp", # Function. Gets the process group ID of the current process.
162
+ "getpid", # Function. Gets the current process ID (os.getpid).
163
+ "getppid", # Function. Gets the parent process ID (os.getppid).
164
+ "getpriority", # Function. Gets the scheduling priority of a process.
165
+ "getsid", # Function. Gets the session ID of a process.
166
+ "getuid", # Function. Gets the user ID (os.getuid).
167
+ "initgroups", # Function. Initializes group access list for a user.
168
+ "isatty", # Function. Checks if a file descriptor is a terminal (os.isatty).
169
+ "kill", # Function. Sends a signal to a process (os.kill).
170
+ "killpg", # Function. Sends a signal to a process group.
171
+ "lchflags", # Function. Sets flags on a symbolic link.
172
+ "lchmod", # Function. Changes permissions of a symbolic link.
173
+ "lchown", # Function. Changes ownership of a symbolic link.
174
+ "link", # Function. Creates a hard link (os.link).
175
+ "listdir", # Function. Lists directory contents (os.listdir).
176
+ "lockf", # Function. Applies or removes advisory locks on a file descriptor.
177
+ "login_tty", # Function. Prepares a terminal for login.
178
+ "lseek", # Function. Repositions the file offset for a file descriptor (os.lseek).
179
+ "lstat", # Function. Gets file status for a symbolic link (os.lstat).
180
+ "major", # Function. Extracts the major device number from a device ID.
181
+ "makedev", # Function. Creates a device ID from major and minor numbers.
182
+ "minor", # Function. Extracts the minor device number from a device ID.
183
+ "mkdir", # Function. Creates a directory (os.mkdir).
184
+ "mkfifo", # Function. Creates a FIFO (named pipe) (os.mkfifo).
185
+ "mknod", # Function. Creates a filesystem node (file, device, etc.).
186
+ "nice", # Function. Adjusts process priority.
187
+ "open", # Function. Opens a file descriptor (os.open).
188
+ "openpty", # Function. Opens a pseudo-terminal pair.
189
+ "pathconf", # Function. Gets configuration values for a path (os.pathconf).
190
+ "pipe", # Function. Creates a pipe (os.pipe).
191
+ "posix_spawn", # Function. Spawns a new process.
192
+ "posix_spawnp", # Function. Spawns a new process using PATH.
193
+ "pread", # Function. Reads from a file descriptor at a given offset.
194
+ "preadv", # Function. Reads from a file descriptor into multiple buffers.
195
+ "putenv", # Function. Sets an environment variable.
196
+ "pwrite", # Function. Writes to a file descriptor at a given offset.
197
+ "pwritev", # Function. Writes from multiple buffers to a file descriptor.
198
+ "read", # Function. Reads from a file descriptor (os.read).
199
+ "readlink", # Function. Reads the target of a symbolic link (os.readlink).
200
+ "readv", # Function. Reads into multiple buffers from a file descriptor.
201
+
202
+ #"register_at_fork", # Function. Registers functions to run before/after fork.
203
+
204
+ "remove", # Function. Removes a file (os.remove).
205
+ "rename", # Function. Renames a file or directory (os.rename).
206
+ "replace", # Function. Renames a file, replacing the destination if it exists.
207
+ "rmdir", # Function. Removes a directory (os.rmdir).
208
+ "scandir", # Function. Lists directory entries with metadata (os.scandir).
209
+ "sched_get_priority_max", # Function. Gets maximum scheduling priority.
210
+ "sched_get_priority_min", # Function. Gets minimum scheduling priority.
211
+ "sched_yield", # Function. Yields the processor.
212
+ "sendfile", # Function. Transfers data between file descriptors.
213
+ "set_blocking", # Function. Sets blocking mode for a file descriptor.
214
+ "set_inheritable", # Function. Sets whether a file descriptor is inheritable.
215
+ "setegid", # Function. Sets the effective group ID.
216
+ "seteuid", # Function. Sets the effective user ID.
217
+ "setgid", # Function. Sets the group ID.
218
+ "setgroups", # Function. Sets supplementary group IDs.
219
+ "setpgid", # Function. Sets the process group ID for a process.
220
+ "setpgrp", # Function. Sets the process group ID.
221
+ "setpriority", # Function. Sets the scheduling priority of a process.
222
+ "setregid", # Function. Sets real and effective group IDs.
223
+ "setreuid", # Function. Sets real and effective user IDs.
224
+ "setsid", # Function. Creates a new session.
225
+ "setuid", # Function. Sets the user ID.
226
+ "stat", # Function. Gets file status (os.stat).
227
+ "statvfs", # Function. Gets filesystem information.
228
+ "symlink", # Function. Creates a symbolic link (os.symlink).
229
+ "sync", # Function. Synchronizes all filesystems.
230
+ "sysconf", # Function. Gets system configuration values (os.sysconf).
231
+ "system", # Function. Executes a shell command (os.system).
232
+ "tcgetpgrp", # Function. Gets the process group associated with a terminal.
233
+ "tcsetpgrp", # Function. Sets the process group associated with a terminal.
234
+ "times", # Function. Gets process times (os.times).
235
+ "truncate", # Function. Truncates a file to a specified length (os.truncate).
236
+ "ttyname", # Function. Returns the terminal name for a file descriptor.
237
+ "umask", # Function. Sets or gets the file creation mask (os.umask).
238
+ "uname", # Function. Gets system information (os.uname).
239
+ "unlink", # Function. Removes a file (alias for os.remove).
240
+ "unsetenv", # Function. Removes an environment variable.
241
+ "urandom", # Function. Generates random bytes (os.urandom).
242
+ "utime", # Function. Sets file access/modification times (os.utime).
243
+ "wait", # Function. Waits for a child process to terminate.
244
+ "wait3", # Function. Waits for a child process with options.
245
+ "wait4", # Function. Waits for a specific child process with options.
246
+ "waitpid", # Function. Waits for a specific process ID (os.waitpid).
247
+ "write", # Function. Writes to a file descriptor (os.write).
248
+ "writev", # Function. Writes from multiple buffers to a file descriptor.
249
+ ]
250
+
251
+ [posix.wrap]
252
+ posix_spawn = "retracesoftware.install.edgecases.posix_spawn"
253
+
254
+ [_posixsubprocess]
255
+ proxy = ["fork_exec"]
256
+
257
+ [_posixsubprocess.wrap]
258
+ fork_exec = "retracesoftware.install.edgecases.fork_exec"
259
+
260
+ [fnctl]
261
+ proxy = ["fcntl", "flock", "ioctl", "lockf"]
262
+
263
+ [_signal]
264
+ proxy = [
265
+ "alarm",
266
+ "getitimer",
267
+ "getsignal", "pause", "pthread_kill", "pthread_sigmask", "raise_signal", "set_wakeup_fd",
268
+ "setitimer", "siginterrupt", "signal", "sigpending", "sigwait"]
269
+
270
+ [_socket]
271
+ # ignore = "CAPI"
272
+ immutable = ["error", "herror", "gaierror", "timeout"]
273
+ proxy = ["socket",
274
+ "close",
275
+ "dup",
276
+ "getaddrinfo",
277
+ "getdefaulttimeout",
278
+ "gethostbyaddr",
279
+ "gethostbyname",
280
+ "gethostbyname_ex",
281
+ "gethostname",
282
+ "getnameinfo",
283
+ "getprotobyname",
284
+ "getservbyname",
285
+ "getservbyport",
286
+ "has_ipv6",
287
+ "if_indextoname",
288
+ "if_nameindex",
289
+ "if_nametoindex",
290
+ "setdefaulttimeout",
291
+ "sethostname",
292
+ "socketpair"]
293
+ # default = "try_proxy"
294
+
295
+ [_socket.patch_class.socket]
296
+ recvfrom_into = "retracesoftware.install.edgecases.recvfrom_into"
297
+ recv_into = "retracesoftware.install.edgecases.recv_into"
298
+ recvmsg_into = "retracesoftware.install.edgecases.recvmsg_into"
299
+
300
+ [select]
301
+ proxy = ["kevent", "kqueue", "poll", "epoll", "select"]
302
+
303
+ [_sqlite3]
304
+ proxy = ["Blob", "Connection", "Cursor", "adapt", "connect"]
305
+ default = "try_proxy"
306
+
307
+ [_ssl]
308
+ proxy = ["_SSLSocket", "MemoryBIO", "_SSLContext"]
309
+
310
+ [_ssl.patch_class._SSLSocket]
311
+ read = "retracesoftware.install.edgecases.read"
312
+
313
+ [ssl]
314
+ bind = ["Options"]
315
+
316
+ # "_ssl": {
317
+ # "proxy_all_except": [],
318
+
319
+ # "proxy_functions": ".*",
320
+ # "comment": {
321
+ # "proxy_types": [
322
+ # "MemoryBIO",
323
+ # "_SSLSocket",
324
+ # "_SSLContext"
325
+ # ],
326
+ # "wrap": {
327
+ # "_SSLSocket.write": "write"
328
+ # }
329
+ # },
330
+ # "patchtype": {
331
+ # "_SSLSocket": {
332
+ # "read": "retracesoftware.install.edgecases.read"
333
+ # }
334
+ # }
335
+ # },
336
+
337
+ [_random]
338
+ proxy = ["Random"]
339
+
340
+ # "_random": {
341
+ # "proxy_all_except": [],
342
+ # "proxy_types": [
343
+ # "Random"
344
+ # ],
345
+ # "proxy_functions": ".*"
346
+ # },
347
+
348
+ # "_multiprocessing": {
349
+ # "proxy": ["sem_unlink", "SemLock"]
350
+ # },
351
+
352
+ # ["multiprocessing.context"]
353
+ # proxy = "BaseContext"
354
+
355
+ [_multiprocessing]
356
+ proxy = ["SemLock", "sem_unlink"]
357
+
358
+
359
+ # "multiprocessing.context": {
360
+ # "comment": {
361
+ # "proxy": ["_default_context"]
362
+ # }
363
+ # },
364
+
365
+ # "PIL._imaging": {
366
+ # "map_buffer": "ignore",
367
+ # "*": "proxy_if_function"
368
+ # },
369
+ # "psycopg2._psycopg": {
370
+ # "proxy_all_except": ["Error"]
371
+ # },
372
+
373
+ # "_weakrefset": {
374
+ # "WeakSet": "sync_type",
375
+ # "_IterationGuard": "sync_type"
376
+ # },
377
+ # "_collections": {
378
+ # "sync_types": [
379
+ # "deque"
380
+ # ]
381
+ # },
382
+ # "_queue": {
383
+ # "sync_types": [
384
+ # "SimpleQueue"
385
+ # ]
386
+ # }
387
+ # }
388
+ # }
@@ -0,0 +1,218 @@
1
+ logging
2
+ hmac
3
+ sys
4
+ builtins
5
+ _frozen_importlib
6
+ _imp
7
+ _thread
8
+ _warnings
9
+ _weakref
10
+ _io
11
+ marshal
12
+ posix
13
+ _frozen_importlib_external
14
+ time
15
+ zipimport
16
+ _codecs
17
+ codecs
18
+ encodings.aliases
19
+ encodings
20
+ encodings.utf_8
21
+ _signal
22
+ _abc
23
+ abc
24
+ io
25
+ _stat
26
+ stat
27
+ _collections_abc
28
+ errno
29
+ genericpath
30
+ posixpath
31
+ os.path
32
+ os
33
+ _sitebuiltins
34
+ collections.abc
35
+ itertools
36
+ keyword
37
+ _operator
38
+ operator
39
+ reprlib
40
+ _collections
41
+ collections
42
+ _functools
43
+ functools
44
+ types
45
+ enum
46
+ _sre
47
+ re._constants
48
+ re._parser
49
+ re._casefix
50
+ re._compiler
51
+ copyreg
52
+ re
53
+ sitecustomize
54
+ site
55
+ importlib._bootstrap
56
+ importlib._bootstrap_external
57
+ importlib
58
+ importlib.machinery
59
+ importlib._abc
60
+ importlib.util
61
+ runpy
62
+ __main__
63
+ __future__
64
+ _weakrefset
65
+ weakref
66
+ copy
67
+ _ast
68
+ contextlib
69
+ ast
70
+ _opcode
71
+ _opcode_metadata
72
+ opcode
73
+ dis
74
+ linecache
75
+ token
76
+ _tokenize
77
+ tokenize
78
+ inspect
79
+ dataclasses
80
+ _typing
81
+ typing
82
+ _json
83
+ json.scanner
84
+ json.decoder
85
+ json.encoder
86
+ json
87
+ warnings
88
+ platform
89
+ _struct
90
+ struct
91
+ encodings.ascii
92
+ encodings.latin_1
93
+ unicodedata
94
+ stringprep
95
+ encodings.idna
96
+ threading
97
+ _socket
98
+ math
99
+ select
100
+ selectors
101
+ array
102
+ socket
103
+ textwrap
104
+ _colorize
105
+ traceback
106
+ codeop
107
+ code
108
+ _heapq
109
+ heapq
110
+ _queue
111
+ queue
112
+ xmlrpc
113
+ binascii
114
+ base64
115
+ _datetime
116
+ datetime
117
+ numbers
118
+ _decimal
119
+ decimal
120
+ http
121
+ email
122
+ email.errors
123
+ _string
124
+ string
125
+ email.quoprimime
126
+ email.base64mime
127
+ quopri
128
+ email.encoders
129
+ email.charset
130
+ email.header
131
+ urllib
132
+ ipaddress
133
+ urllib.parse
134
+ email._parseaddr
135
+ email.utils
136
+ email._policybase
137
+ email.feedparser
138
+ email.parser
139
+ email._encoded_words
140
+ email.iterators
141
+ email.message
142
+ _ssl
143
+ ssl
144
+ http.client
145
+ xml
146
+ xml.parsers
147
+ pyexpat.errors
148
+ pyexpat.model
149
+ pyexpat
150
+ xml.parsers.expat.model
151
+ xml.parsers.expat.errors
152
+ xml.parsers.expat
153
+ _compression
154
+ zlib
155
+ gzip
156
+ xmlrpc.client
157
+ html.entities
158
+ html
159
+ mimetypes
160
+ fnmatch
161
+ _bz2
162
+ bz2
163
+ _lzma
164
+ lzma
165
+ shutil
166
+ socketserver
167
+ http.server
168
+ pkgutil
169
+ sysconfig
170
+ _pyrepl
171
+ _pyrepl.pager
172
+ _sysconfigdata__darwin_darwin
173
+ _osx_support
174
+ pydoc
175
+ fcntl
176
+ xmlrpc.server
177
+ atexit
178
+ termios
179
+ getpass
180
+ ntpath
181
+ glob
182
+ signal
183
+ _ctypes
184
+ ctypes._endian
185
+ ctypes
186
+ _compat_pickle
187
+ _pickle
188
+ pickle
189
+ _locale
190
+ locale
191
+ _bisect
192
+ bisect
193
+ pathlib._abc
194
+ pwd
195
+ grp
196
+ pathlib._local
197
+ pathlib
198
+ _posixsubprocess
199
+ subprocess
200
+ plistlib
201
+ zipfile._path.glob
202
+ zipfile._path
203
+ zipfile
204
+ importlib.metadata._meta
205
+ importlib.metadata._collections
206
+ importlib.metadata._functools
207
+ importlib.metadata._itertools
208
+ _random
209
+ random
210
+ tempfile
211
+ importlib.resources.abc
212
+ importlib.resources._common
213
+ importlib.resources._functional
214
+ importlib.resources
215
+ importlib.abc
216
+ importlib.metadata
217
+ importlib.metadata._text
218
+ importlib.metadata._adapters
@@ -0,0 +1,3 @@
1
+ from retracesoftware.proxy.record import RecordProxySystem
2
+ from retracesoftware.proxy.replay import ReplayProxySystem
3
+ from retracesoftware.proxy.thread import per_thread_messages
@@ -0,0 +1,49 @@
1
+ import retracesoftware.functional as functional
2
+ import retracesoftware_utils as utils
3
+
4
+ from retracesoftware.proxy.proxytype import ExtendingProxy
5
+
6
+ # from retracesoftware.proxy.proxytype import ExtendingProxy
7
+
8
+ # unproxy_execute = functional.mapargs(starting = 1,
9
+ # transform = functional.walker(utils.try_unwrap),
10
+ # function = functional.apply)
11
+
12
+ def adapter(function,
13
+ proxy_input,
14
+ proxy_output,
15
+ on_call = None,
16
+ on_result = None,
17
+ on_error = None):
18
+
19
+ # function = functional.apply
20
+
21
+ if on_call: function = utils.observer(on_call = on_call, function = function)
22
+
23
+ #functional.observer(on_call = on_call, function = function)
24
+
25
+ function = functional.mapargs(starting = 1, transform = proxy_input, function = function)
26
+
27
+ function = functional.sequence(function, proxy_output)
28
+
29
+ if on_result or on_error:
30
+ function = utils.observer(on_result = on_result, on_error = on_error, function = function)
31
+
32
+ return function
33
+
34
+ def adapter_pair(int, ext):
35
+ return (
36
+ adapter(
37
+ function = ext.apply,
38
+ proxy_input = int.proxy,
39
+ proxy_output = ext.proxy,
40
+ on_call = ext.on_call,
41
+ on_result = ext.on_result,
42
+ on_error = ext.on_error),
43
+ adapter(
44
+ function = int.apply,
45
+ proxy_input = ext.proxy,
46
+ proxy_output = int.proxy,
47
+ on_call = int.on_call,
48
+ on_result = int.on_result,
49
+ on_error = int.on_error))
@@ -0,0 +1,31 @@
1
+ import types
2
+ import sys
3
+
4
+ def find_module_name(mod):
5
+ for name,value in sys.modules.items():
6
+ if value is mod:
7
+ return name
8
+
9
+ raise Exception(f"Cannot create GlobalRef as module {mod} not found in sys.modules")
10
+
11
+ class GlobalRef:
12
+ __slots__ = ['parts']
13
+
14
+ def __init__(self, obj):
15
+ if isinstance(obj, types.ModuleType):
16
+ self.parts = (find_module_name(obj),)
17
+ else:
18
+ raise Exception(f"Cannot create GlobalRef from {obj}")
19
+
20
+ def __call__(self):
21
+ module = self.parts[0]
22
+
23
+ if len(self.parts) == 0:
24
+ return module
25
+ else:
26
+ obj = getattr(module, self.parts[1])
27
+
28
+ if len(self.parts) == 1:
29
+ return obj
30
+ else:
31
+ raise Exception(f"TODO")