Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Fable.Python.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
<Compile Include="stdlib/Ast.fs" />
<Compile Include="stdlib/Builtins.fs" />
<Compile Include="stdlib/Json.fs" />
<Compile Include="stdlib/Math.fs" />
<Compile Include="stdlib/Os.fs" />
<Compile Include="stdlib/TkInter.fs" />
<Compile Include="stdlib/Queue.fs" />
<Compile Include="stdlib/Math.fs" />
<Compile Include="stdlib/Sys.fs" />
<Compile Include="stdlib/Time.fs" />
<Compile Include="stdlib/TkInter.fs" />

<Compile Include="cognite-sdk/CogniteSdk.fs" />
<Compile Include="flask/Flask.fs" />
Expand Down
8 changes: 8 additions & 0 deletions src/stdlib/Os.fs
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
module Fable.Python.Os

open System.Collections.Generic
open Fable.Core

// fsharplint:disable MemberNames

type IExports =
abstract chdir : string -> unit
abstract chroot : string -> unit
abstract close : fd: int -> unit
abstract environ : Dictionary<string, string>
abstract getcwd : unit -> string
abstract getenv : key: string -> string option
abstract getenv : key: string * ``default``: string -> string
abstract kill : pid: int * ``sig``: int -> unit
abstract putenv : key: string * value: string -> unit


/// Miscellaneous operating system interfaces
[<ImportAll("os")>]
let os: IExports = nativeOnly
33 changes: 33 additions & 0 deletions src/stdlib/Sys.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module Fable.Python.Sys

open Fable.Core

// fsharplint:disable MemberNames

[<StringEnum>]
type ByteOrder =
| Little
| Big

type VersionInfo =
abstract major : int
abstract minor: int
abstract micro: int
abstract releaselevel: string
abstract serial: int

type IExports =
abstract argv : string array
abstract byteorder: ByteOrder
abstract hexversion: int
abstract maxsize: int
abstract maxunicode: int
abstract path : string array
abstract platform : string
abstract prefix: string
abstract version: string
abstract version_info: VersionInfo

/// System-specific parameters and functions
[<ImportAll("sys")>]
let sys: IExports = nativeOnly
22 changes: 22 additions & 0 deletions src/stdlib/Time.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Fable.Python.Time

open Fable.Core

// fsharplint:disable MemberNames

type IExports =
abstract altzone : int
abstract ctime : unit -> string
abstract ctime : float -> string
abstract daylight : int
abstract monotonic : unit -> float
abstract perf_counter : unit -> float
abstract process_time : unit -> float
abstract sleep : secs: float -> unit
abstract time : unit -> float
abstract timezone : int
abstract tzname : string * string

/// Time access and conversions
[<ImportAll("time")>]
let time: IExports = nativeOnly