summaryrefslogtreecommitdiff
path: root/modules/language/python/module/sys.scm
blob: aa4a166ad7483bf09b6b4e25319f898198e4de84 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
(define-module (language python module sys)
  #:use-module (rnrs bytevectors)
  #:use-module (language python exceptions)
  #:use-module (language python hash)
  #:use-module (language python compile)
  #:use-module (language python module io)
  #:use-module (language python try)
  #:use-module (language python string)
  #:use-module (language python module python)
  #:use-module (oop pf-objects)
  #:export (argv byteorder copyright implementation
		     stdin     stdout     stderr
		   __stdin__ __stdout__ __stderr__
		   exit version_info version api_version
                   warnoptions winver _xoption
                   tarcebacklimit platform maxsize hash_info
                   base_prefix))

(define-syntax stdin_
  (lambda (x)
    (syntax-case x (set!)
      ((set! stdin port)
       #'(set-current-input-port port))
      ((_ . _)
       (error "sys.stdin is not a function"))
      (s #'(current-input-port)))))

(define-syntax stdout_
  (lambda (x)
    (syntax-case x (set!)
      ((set! stdin port)
       #'(set-current-output-port port))
      ((_ . _)
       (error "sys.stdin is not a function"))
      (s #'(current-output-port)))))

(define-syntax stderr_
  (lambda (x)
    (syntax-case x (set!)
      ((set! stdin port)
       #'(set-current-error-port port))
      ((_ . _)
       (error "sys.stdin is not a function"))
      (s #'(current-error-port)))))

(define stdin  (FileIO stdin_ ))
(define stderr (FileIO stderr_))
(define stdout (FileIO stdout_))

(define __stdin__  stdin)
(define __stdout__ stdout)
(define __stderr__ stderr)

(define abiflags         '(""))
(define argv              (command-line))
(define base_exec_prefix  #f)
(define base_prefix       "/usr")
(define byteorder         (if (eq? (native-endianness) 'little)
			      "little"
			      "big"))
(define builtin_module_names '())
(define call_tracing
  (lambda (func args)
    (apply func args)))
(define copyright "Stefan Israelsson Tampe")
(define _clear_type_cache
  (lambda () (values)))
(define _current_frames
  (lambda () '()))
(define _debugmallocstats
  (lambda () (values)))

(define dllhandle 0)

(define _ #f)

(define displayhook
  (lambda (value)
    (when (not (eq? value None))
      (write stdout (repr value))
      (set! _ value))))

(define dont_write_bytecode #f)
(define excepthook
  (lambda (type value traceback)
    (write stderr (repr (list type value traceback)))))

(define __displayhook__ displayhook)
(define __excepthook__  excepthook)

(define exc_info
  (lambda () (values)))

(define exec_prefix "/usr/local")
(define executable "")
(define exit
  (lambda (arg)
    (if (fluid-ref exit-fluid)
        (abort-to-prompt exit-prompt arg)
        ((@ (guile) exit) arg))))

(define flags '())
(define float_info '())
(define float_repr_style #f)

(define getallocatedblocks
  (lambda () 0))
(define getcheckinterval
  (lambda () 0))

(define getdefaultencoding
  (lambda () #f))

(define getdlopenflags
  (lambda () '()))

(define getfilesystemencoding
  (lambda () #f))

(define getfilesystemcodeerrors
  (lambda () #f))

(define getrefcount
  (lambda () 0))

(define getsizeof
  (lambda x #f))

(define getswitchinterval
  (lambda () 0))

(define _getframe
  (lambda x 0))

(define getwindowsversion
  (lambda () 0))

(define implementation "guile")

(define int_info #f)

(define __interactivehook__ (lambda () (values)))


(define intern (lambda (s) (values)))

(define is_finalizing
  (lambda () #f))

(define last_type      #f)
(define last_value     #f)
(define last_traceback #f)
    
(define maxsize     (- (ash 1 63) 2))
(define maxunicode #f)

(define meta_path '())
(define modules (@ (language python module) modules))
(define path '())
(define path_hooks '())
(define path_importer_cache (make-hash-table))

(define-python-class hash_info ()
  (define modulus pyhash-N)
  (define inf     ((@ (guile) hash) 'inf pyhash-N))
  (define nan     ((@ (guile) hash) 'nan pyhash-N)))

(define platform "linux")

(define prefix "")
(define ps1    "")
(define ps2    "")

(define setcheckinterval
  (lambda (i) (values)))

(define setdlopenflags
  (lambda (n) (values)))

(define setprofile
  (lambda (f) (values)))

(define setrecursionlimit
  (lambda (n) (values)))

(define setswitchinterval
  (lambda (i) (values)))

(define settrace
  (lambda (f) (values)))

(define set_asyncgen_hooks
  (lambda (a b) (values)))

(define set_coroutine_wrappr
  (lambda (w) (values)))

(define _enablelegacywindowsfsencoding
  (lambda () (values)))

(define thread_info #f)

(define tracebacklimit 0)

(define version     "0.0.0")
(define api_version "0.0.0")
(define version_info '(3 7))
(define warnoptions   #f)
(define winver        0)
(define _xoptions    (make-hash-table))