Upload files to 'settings'
This commit is contained in:
parent
df5b615ef9
commit
165cb225b4
1 changed files with 16 additions and 4 deletions
|
@ -6,6 +6,9 @@ import datetime
|
||||||
import platform
|
import platform
|
||||||
from subprocess import *
|
from subprocess import *
|
||||||
|
|
||||||
|
# studio
|
||||||
|
from studio import history
|
||||||
|
|
||||||
ostype = platform.system()
|
ostype = platform.system()
|
||||||
|
|
||||||
def Open(arg): # XDG-OPEN (start the file in a default software)
|
def Open(arg): # XDG-OPEN (start the file in a default software)
|
||||||
|
@ -34,11 +37,11 @@ def Open(arg): # XDG-OPEN (start the file in a default software)
|
||||||
|
|
||||||
# For The Best OS Ever
|
# For The Best OS Ever
|
||||||
if ostype == "Linux": ##### ## ## ## ##
|
if ostype == "Linux": ##### ## ## ## ##
|
||||||
os.system("xdg-open "+arg) ## ## #### ## ## ##
|
Popen(["xdg-open", arg]) ## ## #### ## ## ##
|
||||||
# For Stinky ## ## ## ## ## ##
|
# For Stinky. Like very, very Stinky ## ## ## ## ## ##
|
||||||
elif ostype == "Windows": ## #### ## ## ## ## ##
|
elif ostype == "Windows": ## #### ## ## ## ## ##
|
||||||
os.system("start "+arg) ## # ## ## ## ## ## ##
|
os.system("start "+arg) ## # ## ## ## ## ## ##
|
||||||
# For Not that Stinky ## ## ## #### ## ##
|
# For Not that Stinky but it is Stinky ## ## ## #### ## ##
|
||||||
elif ostype == "Darwin": ##### ## ## ####
|
elif ostype == "Darwin": ##### ## ## ####
|
||||||
os.system("open "+arg)
|
os.system("open "+arg)
|
||||||
|
|
||||||
|
@ -88,7 +91,13 @@ def file_open(win, path):
|
||||||
|
|
||||||
if blendfile:
|
if blendfile:
|
||||||
Popen([get_current_blender(), path])
|
Popen([get_current_blender(), path])
|
||||||
|
|
||||||
|
# Every blend file opening should be recorded to history. Because then
|
||||||
|
# on multiuser, the other users should somehow know that changes were
|
||||||
|
# done to the blendfile.
|
||||||
|
|
||||||
|
history.record(win, path, "[Openned]")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Open(path)
|
Open(path)
|
||||||
|
|
||||||
|
@ -157,6 +166,9 @@ def copy_file(win, from_path, to_path, new_name=""):
|
||||||
+" --python-expr import\ bpy\;\ bpy.ops.wm.save_as_mainfile\(filepath=\\\""\
|
+" --python-expr import\ bpy\;\ bpy.ops.wm.save_as_mainfile\(filepath=\\\""\
|
||||||
+to_path.replace(" ", "\ ")+"\\\"\)")
|
+to_path.replace(" ", "\ ")+"\\\"\)")
|
||||||
|
|
||||||
|
# Writting to history. Since each copy of a file is adding a blendfile.
|
||||||
|
history.record(win, to_path, "[Added]")
|
||||||
|
|
||||||
if still:
|
if still:
|
||||||
|
|
||||||
# If it's not a blendfile we going to use this.
|
# If it's not a blendfile we going to use this.
|
||||||
|
|
Loading…
Add table
Reference in a new issue