Skip to content

Commit 4faec88

Browse files
committed
Added sys module (partly)
1 parent 35aac3a commit 4faec88

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

src/Fable.Python.fsproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
<Compile Include="stdlib/Ast.fs" />
1313
<Compile Include="stdlib/Builtins.fs" />
1414
<Compile Include="stdlib/Json.fs" />
15+
<Compile Include="stdlib/Math.fs" />
1516
<Compile Include="stdlib/Os.fs" />
16-
<Compile Include="stdlib/TkInter.fs" />
1717
<Compile Include="stdlib/Queue.fs" />
18-
<Compile Include="stdlib/Math.fs" />
18+
<Compile Include="stdlib/Sys.fs" />
19+
<Compile Include="stdlib/TkInter.fs" />
1920

2021
<Compile Include="cognite-sdk/CogniteSdk.fs" />
2122
<Compile Include="flask/Flask.fs" />

src/stdlib/Os.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
module Fable.Python.Os
22

3+
open System.Collections.Generic
34
open Fable.Core
45

56
// fsharplint:disable MemberNames
67

78
type IExports =
9+
abstract environ : Dictionary<string, string>
810
abstract getenv : key: string -> string option
911
abstract getenv : key: string * ``default``: string -> string
1012
abstract putenv : key: string * value: string -> unit
1113

1214

15+
/// Miscellaneous operating system interfaces
1316
[<ImportAll("os")>]
1417
let os: IExports = nativeOnly

src/stdlib/Sys.fs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module Fable.Python.Sys
2+
3+
open Fable.Core
4+
5+
// fsharplint:disable MemberNames
6+
7+
[<StringEnum>]
8+
type ByteOrder =
9+
| Little
10+
| Big
11+
12+
type VersionInfo =
13+
abstract major : int
14+
abstract minor: int
15+
abstract micro: int
16+
abstract releaselevel: string
17+
abstract serial: int
18+
19+
type IExports =
20+
abstract argv : string array
21+
abstract byteorder: ByteOrder
22+
abstract hexversion: int
23+
abstract maxsize: int
24+
abstract maxunicode: int
25+
abstract path : string array
26+
abstract platform : string
27+
abstract prefix: string
28+
abstract version: string
29+
abstract version_info: VersionInfo
30+
31+
/// System-specific parameters and functions
32+
[<ImportAll("sys")>]
33+
let sys: IExports = nativeOnly

0 commit comments

Comments
 (0)