-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpaths.py
More file actions
executable file
·28 lines (24 loc) · 858 Bytes
/
paths.py
File metadata and controls
executable file
·28 lines (24 loc) · 858 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
#!/usr/bin/env python3
import api
from sys import stderr
# ------------------------------
# Config:
DEBUG = False
# ------------------------------
if __name__ == '__main__':
try:
print('Fetching file structure...\n', file=stderr) # Prints to stderr to ignore this if piped into a text file
files = api.fetchFileStructure()
print('IDs:')
for rmFile in api.iterateAll(files):
print('%s: %s' % (rmFile.id, rmFile.path()))
except Exception as ex:
# Error handling:
if DEBUG:
raise ex
exit(1)
else:
print('ERROR: %s' % ex, file=stderr)
print(file=stderr)
print('Please make sure your reMarkable is connected to this PC and you have enabled the USB Webinterface in "Settings -> Storage".', file=stderr)
exit(1)