tictacsync 0.98a0__py3-none-any.whl → 1.4.0b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tictacsync might be problematic. Click here for more details.
- tictacsync/device_scanner.py +62 -268
- tictacsync/entry.py +57 -166
- tictacsync/load_fieldr_reaper.py +352 -0
- tictacsync/mamconf.py +157 -0
- tictacsync/mamdav.py +642 -0
- tictacsync/mamreap.py +481 -0
- tictacsync/mamsync.py +343 -0
- tictacsync/multi2polywav.py +4 -3
- tictacsync/new-sound-resolve.py +469 -0
- tictacsync/newmix.py +483 -0
- tictacsync/remrgmx.py +6 -10
- tictacsync/splitmix.py +87 -0
- tictacsync/timeline.py +154 -98
- tictacsync/yaltc.py +359 -31
- {tictacsync-0.98a0.dist-info → tictacsync-1.4.0b0.dist-info}/METADATA +5 -6
- tictacsync-1.4.0b0.dist-info/RECORD +24 -0
- tictacsync-1.4.0b0.dist-info/entry_points.txt +7 -0
- tictacsync-0.98a0.dist-info/RECORD +0 -16
- tictacsync-0.98a0.dist-info/entry_points.txt +0 -4
- {tictacsync-0.98a0.dist-info → tictacsync-1.4.0b0.dist-info}/LICENSE +0 -0
- {tictacsync-0.98a0.dist-info → tictacsync-1.4.0b0.dist-info}/WHEEL +0 -0
- {tictacsync-0.98a0.dist-info → tictacsync-1.4.0b0.dist-info}/top_level.txt +0 -0
tictacsync/mamconf.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import argparse, platformdirs, configparser, sys
|
|
2
|
+
from loguru import logger
|
|
3
|
+
from pprint import pformat
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from rich import print
|
|
6
|
+
|
|
7
|
+
# [TODO] add in the doc:
|
|
8
|
+
# RAWROOT (sources with TC): "/Users/foobar/movies/MyBigMovie/"
|
|
9
|
+
# SYNCEDROOT (where RAWROOT will be mirrored, but with synced clips): "/Users/foobar/synced"
|
|
10
|
+
# SNDROOT (destination of ISOs sound files): "/Users/foobar/MovieSounds"
|
|
11
|
+
# then
|
|
12
|
+
# "/Users/foobar/synced/MyBigMovie" and "/Users/foobar/MovieSounds/MyBigMovie" will be created
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
CONF_FILE = 'mamsync.cfg'
|
|
16
|
+
LOG_FILE = 'mamdone.txt'
|
|
17
|
+
|
|
18
|
+
logger.remove()
|
|
19
|
+
# logger.add(sys.stdout, level="DEBUG")
|
|
20
|
+
# logger.add(sys.stdout, filter=lambda r: r["function"] == "write_conf")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def print_out_conf(raw_root, synced_root, snd_root, proxies=''):
|
|
24
|
+
print(f'RAWROOT (sources with TC): "{raw_root}"')
|
|
25
|
+
print(f'SYNCEDROOT (where RAWROOT will be mirrored, but with synced clips): "{synced_root}"')
|
|
26
|
+
print(f'SNDROOT (destination of ISOs sound files): "{snd_root}"')
|
|
27
|
+
if proxies != '':
|
|
28
|
+
print(f'PROXIES (NLE proxy clips folder): "{proxies}"')
|
|
29
|
+
|
|
30
|
+
def write_conf(conf_key, conf_val):
|
|
31
|
+
# args are pahtlib.Paths.
|
|
32
|
+
# RAWROOT: files with TC (and ROLL folders), as is from cameras
|
|
33
|
+
# SYNCEDROOT: synced and no more TC (ROLL flattened)
|
|
34
|
+
# Writes configuration on filesystem for later retrieval
|
|
35
|
+
# Clears log of already synced clips.
|
|
36
|
+
conf_dir = platformdirs.user_config_dir('mamsync', 'plutz', ensure_exists=True)
|
|
37
|
+
current_values = dict(zip(['RAWROOT', 'SYNCEDROOT', 'SNDROOT', 'PROXIES'],
|
|
38
|
+
get_proj()))
|
|
39
|
+
logger.debug(f'old values {current_values}')
|
|
40
|
+
current_values[conf_key] = conf_val
|
|
41
|
+
logger.debug(f'updated values {current_values}')
|
|
42
|
+
conf_file = Path(conf_dir)/CONF_FILE
|
|
43
|
+
logger.debug('writing config in %s'%conf_file)
|
|
44
|
+
# print(f'\nWriting folders paths in configuration file "{conf_file}"')
|
|
45
|
+
# print_out_conf(raw_root, synced_root, snd_root)
|
|
46
|
+
conf_prs = configparser.ConfigParser()
|
|
47
|
+
conf_prs['SECTION1'] = current_values
|
|
48
|
+
with open(conf_file, 'w') as configfile_handle:
|
|
49
|
+
conf_prs.write(configfile_handle)
|
|
50
|
+
with open(conf_file, 'r') as configfile_handle:
|
|
51
|
+
logger.debug(f'config file content: \n{configfile_handle.read()}')
|
|
52
|
+
|
|
53
|
+
def get_proj(print_conf_stdout=False):
|
|
54
|
+
# check if user started a project before.
|
|
55
|
+
# stored in platformdirs.user_config_dir
|
|
56
|
+
# returns a tuple of strings (RAWROOT, SYNCEDROOTS, SNDROOT, PROXIES)
|
|
57
|
+
# if any, or a tuple of 4 empty strings '' otherwise.
|
|
58
|
+
# print location of conf file if print_conf_stdout
|
|
59
|
+
# Note: only raw_root contains the name project
|
|
60
|
+
conf_dir = platformdirs.user_config_dir('mamsync', 'plutz')
|
|
61
|
+
conf_file = Path(conf_dir)/CONF_FILE
|
|
62
|
+
logger.debug('try reading config in %s'%conf_file)
|
|
63
|
+
if print_conf_stdout:
|
|
64
|
+
print(f'Will read configuration from file {conf_file}')
|
|
65
|
+
if conf_file.exists():
|
|
66
|
+
conf_prs = configparser.ConfigParser()
|
|
67
|
+
conf_prs.read(conf_file)
|
|
68
|
+
try:
|
|
69
|
+
RAWROOT = conf_prs.get('SECTION1', 'RAWROOT')
|
|
70
|
+
except configparser.NoOptionError:
|
|
71
|
+
RAWROOT = ''
|
|
72
|
+
try:
|
|
73
|
+
SYNCEDROOT = conf_prs.get('SECTION1', 'SYNCEDROOT')
|
|
74
|
+
except configparser.NoOptionError:
|
|
75
|
+
SYNCEDROOT = ''
|
|
76
|
+
try:
|
|
77
|
+
PROXIES = conf_prs.get('SECTION1', 'PROXIES')
|
|
78
|
+
except configparser.NoOptionError:
|
|
79
|
+
PROXIES = ''
|
|
80
|
+
try:
|
|
81
|
+
SNDROOT = conf_prs.get('SECTION1', 'SNDROOT')
|
|
82
|
+
except configparser.NoOptionError:
|
|
83
|
+
SNDROOT = ''
|
|
84
|
+
logger.debug('read from conf: RAWROOT= %s SYNCEDROOT= %s SNDROOT=%s PROXIES=%s'%
|
|
85
|
+
(RAWROOT, SYNCEDROOT, SNDROOT, PROXIES))
|
|
86
|
+
return RAWROOT, SYNCEDROOT, SNDROOT, PROXIES
|
|
87
|
+
else:
|
|
88
|
+
logger.debug(f'no config file found at {conf_file}')
|
|
89
|
+
print('No configuration found.')
|
|
90
|
+
return '', '', '', ''
|
|
91
|
+
|
|
92
|
+
def new_parser():
|
|
93
|
+
parser = argparse.ArgumentParser()
|
|
94
|
+
parser.add_argument('--rr',
|
|
95
|
+
nargs = 1,
|
|
96
|
+
dest='rawroot',
|
|
97
|
+
help='Sets new value for raw root folder (i.e.: clips with TC)')
|
|
98
|
+
parser.add_argument('--sr',
|
|
99
|
+
nargs = 1,
|
|
100
|
+
dest='syncedroot',
|
|
101
|
+
help="""Sets where the synced files will be written, to be used by the NLE. Will contain a mirror copy of RAWROOT """)
|
|
102
|
+
parser.add_argument('--pr',
|
|
103
|
+
nargs = 1,
|
|
104
|
+
dest='proxies',
|
|
105
|
+
help='Sets where the proxy files are stored by the NLE')
|
|
106
|
+
parser.add_argument('--sf',
|
|
107
|
+
nargs = 1,
|
|
108
|
+
dest='sndfolder',
|
|
109
|
+
help='Sets value for sound folder (will contain a mirror copy of RAWROOT, but with ISO files only)')
|
|
110
|
+
parser.add_argument('--clearconf',
|
|
111
|
+
action='store_true',
|
|
112
|
+
dest='clearconf',
|
|
113
|
+
help='Clear configured values.')
|
|
114
|
+
parser.add_argument('--showconf',
|
|
115
|
+
action='store_true',
|
|
116
|
+
dest='showconf',
|
|
117
|
+
help='Show current configured values.')
|
|
118
|
+
return parser
|
|
119
|
+
|
|
120
|
+
def main():
|
|
121
|
+
parser = new_parser()
|
|
122
|
+
args = parser.parse_args()
|
|
123
|
+
logger.debug(f'arguments from argparse {args}')
|
|
124
|
+
if args.rawroot:
|
|
125
|
+
val = args.rawroot[0]
|
|
126
|
+
write_conf('RAWROOT', val)
|
|
127
|
+
print(f'Set source folder of unsynced clips (rawroot) to:\n{val}')
|
|
128
|
+
sys.exit(0)
|
|
129
|
+
if args.syncedroot:
|
|
130
|
+
val = args.syncedroot[0]
|
|
131
|
+
write_conf('SYNCEDROOT', args.syncedroot[0])
|
|
132
|
+
print(f'Set destination folder of synced clips (syncedroot) to:\n{val}')
|
|
133
|
+
sys.exit(0)
|
|
134
|
+
if args.proxies:
|
|
135
|
+
val = args.proxies[0]
|
|
136
|
+
write_conf('PROXIES', args.proxies[0])
|
|
137
|
+
print(f'Set proxies folder to:\n{val}')
|
|
138
|
+
sys.exit(0)
|
|
139
|
+
if args.sndfolder:
|
|
140
|
+
val = args.sndfolder[0]
|
|
141
|
+
write_conf('SNDROOT', args.sndfolder[0])
|
|
142
|
+
print(f'Set destination folder of ISOs sound files (sndfolder) to:\n{val}')
|
|
143
|
+
sys.exit(0)
|
|
144
|
+
if args.clearconf:
|
|
145
|
+
write_conf('RAWROOT', '')
|
|
146
|
+
write_conf('SYNCEDROOT', '')
|
|
147
|
+
write_conf('SNDROOT', '')
|
|
148
|
+
write_conf('PROXIES', '')
|
|
149
|
+
print_out_conf('','','','')
|
|
150
|
+
sys.exit(0)
|
|
151
|
+
if args.showconf:
|
|
152
|
+
get_proj()
|
|
153
|
+
print_out_conf(*get_proj(True))
|
|
154
|
+
sys.exit(0)
|
|
155
|
+
|
|
156
|
+
if __name__ == '__main__':
|
|
157
|
+
main()
|