-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileManagement.py
70 lines (47 loc) · 1.91 KB
/
fileManagement.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from pathlib import Path
from tkinter import Tk
def codePath():
return Path("C:/Users/andrew/Documents/GitHub/vrAnalysis")
def localDataPath():
return Path("C:/Users/andrew/Documents/localData")
def storagePath():
return Path("D:/localData")
def sharedDataPath():
return localDataPath() / "sharedData"
def analysisPath():
return localDataPath() / "analysis"
def figurePath():
return localDataPath() / "_figure_library"
def serverPath():
return Path("//zaru.cortexlab.net/Subjects")
def getCopyString(mouseName, datestr="", session="", server=serverPath(), toClipboard=True):
sourceString = Path(server / mouseName / datestr / session)
targetString = Path(localDataPath() / mouseName / datestr / session)
cmdPromptCommand = f"robocopy {sourceString} {targetString} /s /xf *.tif *.mj2"
if toClipboard:
tkManager = Tk()
tkManager.clipboard_append(cmdPromptCommand)
tkManager.destroy()
print(cmdPromptCommand)
def copyDataToStorage(mouseName, datestr="", session="", toClipboard=True):
sourceString = Path(localDataPath() / mouseName / datestr / session)
targetString = Path(storagePath() / mouseName / datestr / session)
cmdPromptCommand = f"robocopy {sourceString} {targetString} /s"
if toClipboard:
tkManager = Tk()
tkManager.clipboard_append(cmdPromptCommand)
tkManager.destroy()
print(cmdPromptCommand)
def s2pTargets(*inputs, server=serverPath()):
if len(inputs) == 3:
mouseName, dateString, session = inputs
else:
mouseName = inputs[0].mouseName
dateString = inputs[0].dateString
session = inputs[0].session
sourceString = Path(serverPath() / mouseName / dateString / session)
targetString = Path(localDataPath() / mouseName / dateString / session)
print(sourceString)
print(targetString)
def checkSessionFiles(mouseName, fileIdentifier):
return None