-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefines.py
More file actions
45 lines (32 loc) · 1004 Bytes
/
Copy pathdefines.py
File metadata and controls
45 lines (32 loc) · 1004 Bytes
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
import os
import collections as cl
ENABLE = True
DISABLE = False
use_bytes = 2
use_order = "little"
pro_format = "<QQQd"
sep_byte = b"\xaa"
free_byte = b"\x00"
done_byte = b"\xff"
free = free_byte * use_bytes
done = done_byte * use_bytes
sep_free = sep_byte + free
sep_done = sep_byte + done
one_size = len(sep_byte) + use_bytes
class paths_t (object):
__slots__ = [ "task", "lock" ]
class files_t (object):
__slots__ = [ "wid", "done", "data", "log", "progress", "translate" ]
paths = paths_t()
files = files_t()
def set_task_path (path):
global paths
global files
paths.task = os.path.realpath(path)
paths.lock = os.path.join(paths.task, "locks")
files.wid = os.path.join(paths.task, "id")
files.done = os.path.join(paths.task, "done")
files.data = os.path.join(paths.task, "queue")
files.log = os.path.join(paths.task, "log.out")
files.progress = os.path.join(paths.task, "progress")
files.translate = os.path.join(paths.task, "translate")