Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/python/modules/blenderos.py')
-rw-r--r--intern/python/modules/blenderos.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/intern/python/modules/blenderos.py b/intern/python/modules/blenderos.py
new file mode 100644
index 00000000000..d093388d88f
--- /dev/null
+++ b/intern/python/modules/blenderos.py
@@ -0,0 +1,24 @@
+# This is the built in Blender emulation module for os.py
+# not all features are implemented yet...
+
+import Blender.sys as bsys
+
+sep = bsys.dirsep # path separator ('/' or '\')
+
+class Path:
+ def dirname(self, name):
+ return bsys.dirname(name)
+ def join(self, a, *p):
+ dirsep = bsys.dirsep
+ path = a
+ for b in p:
+ if b[:1] == dirsep:
+ path = b
+ elif path == '' or path[-1:] == dirsep:
+ path = path + b
+ else:
+ path = path + dirsep + b
+ return path
+
+path = Path()
+