kopia lustrzana https://github.com/micropython/micropython-lib
os.path: Add poorman's abspath().
rodzic
c023b96f60
commit
e3c3872185
|
@ -7,6 +7,9 @@ def normcase(s):
|
||||||
def normpath(s):
|
def normpath(s):
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
def abspath(s):
|
||||||
|
return os.getcwd() + "/" + s
|
||||||
|
|
||||||
def join(*args):
|
def join(*args):
|
||||||
# TODO: this is non-compliant
|
# TODO: this is non-compliant
|
||||||
return "/".join(args)
|
return "/".join(args)
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
from os.path import *
|
import sys
|
||||||
|
sys.path[0] = "os"
|
||||||
|
from path import *
|
||||||
|
|
||||||
assert split("") == ("", "")
|
assert split("") == ("", "")
|
||||||
assert split("path") == ("", "path")
|
assert split("path") == ("", "path")
|
||||||
|
|
Ładowanie…
Reference in New Issue