Skip to content

Commit 76efae4

Browse files
committed
os: Move constants definitions to the top.
1 parent 8884dbb commit 76efae4

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

os/os/__init__.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@
99
except:
1010
pass
1111

12+
R_OK = const(4)
13+
W_OK = const(2)
14+
X_OK = const(1)
15+
F_OK = const(0)
16+
17+
O_ACCMODE = 0o0000003
18+
O_RDONLY = 0o0000000
19+
O_WRONLY = 0o0000001
20+
O_RDWR = 0o0000002
21+
O_CREAT = 0o0000100
22+
O_EXCL = 0o0000200
23+
O_NOCTTY = 0o0000400
24+
O_TRUNC = 0o0001000
25+
O_APPEND = 0o0002000
26+
O_NONBLOCK = 0o0004000
27+
28+
error = OSError
29+
name = "posix"
30+
sep = "/"
31+
curdir = "."
32+
pardir = ".."
33+
environ = {"WARNING": "NOT_IMPLEMENTED"}
34+
1235

1336
libc = ffilib.libc()
1437

@@ -50,28 +73,6 @@ def errno_(val=None):
5073
execvp_ = libc.func("i", "execvp", "PP")
5174
getenv_ = libc.func("s", "getenv", "P")
5275

53-
R_OK = const(4)
54-
W_OK = const(2)
55-
X_OK = const(1)
56-
F_OK = const(0)
57-
58-
O_ACCMODE = 0o0000003
59-
O_RDONLY = 0o0000000
60-
O_WRONLY = 0o0000001
61-
O_RDWR = 0o0000002
62-
O_CREAT = 0o0000100
63-
O_EXCL = 0o0000200
64-
O_NOCTTY = 0o0000400
65-
O_TRUNC = 0o0001000
66-
O_APPEND = 0o0002000
67-
O_NONBLOCK = 0o0004000
68-
69-
error = OSError
70-
name = "posix"
71-
sep = "/"
72-
curdir = "."
73-
pardir = ".."
74-
environ = {"WARNING": "NOT_IMPLEMENTED"}
7576

7677

7778
def check_error(ret):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy