Skip to content

Commit 8f60012

Browse files
committed
Added Ph-St's rmrl renderer
1 parent 8eaa171 commit 8f60012

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

render_rmrl.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/python3
2+
3+
# This method uses the third-party renderer rmrl to render reMarkable documents locally on the computer.
4+
# It downloads the raw reMarkable files to the computer and renders them locally.
5+
#
6+
# It requires the Python module rmrl (https://github.com/rschroll/rmrl/) and SSH access to the reMarkable (to download the raw files), but no USB connection.
7+
# It is not extensively tested, and fails in some cases.
8+
#
9+
# Thanks to Ph-St for contributing this renderer (https://github.com/hersle/rmirro/issues/10)!
10+
11+
import sys
12+
import os.path
13+
import subprocess
14+
from rmrl import render
15+
16+
def render_rmrl(input, output):
17+
stream = render(input)
18+
with open(output, "wb") as out_file:
19+
out_file.write(stream.read())
20+
21+
if __name__ == "__main__":
22+
args = sys.argv[1:]
23+
assert len(args) == 2, "usage: render_rmrl.py infile outfile"
24+
25+
infile = args[0]
26+
outfile = args[1]
27+
28+
status = render_rmrl(infile, outfile)
29+
30+
exit(status)

rmirro.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ def download(self):
290290
else: # is file
291291
success = False
292292
for renderer in renderers:
293-
success = pc_run([f"{DIR}/{renderer}", infile, outfile]).returncode == 0 # try to render
293+
proc = pc_run([f"{DIR}/{renderer}", infile, outfile]) # try to render
294+
success = proc.returncode == 0
294295
if len(renderers) > 1 or args.verbose:
295296
print(f"- {renderer}", "succeeded" if success else "failed")
297+
print(proc.stderr, end="")
296298
if success:
297299
break # jump out upon first successful render
298300

0 commit comments

Comments
 (0)