ae-protocol.md: Whitespace
[fuse-aexplorer.git] / fuse-aexplorer.py
1 #!/usr/bin/env python
2 #
3 # A FUSE filesystem to access an Amiga's files via Cloanto's Amiga Explorer.
4 #
5 # Known limitations:
6 #  See README.
7 #
8 # SPDX-License-Identifier: GPL-2.0
9 #
10
11
12 from fusepy import FUSE
13 import sys
14
15 from AEpy.AELink import AELinkSerial
16 from AEpy.AESession import AESession
17 from AEpy.AEFuse import AEFuse
18 from AEpy import FusePatches
19
20
21
22
23
24 if __name__ == '__main__':
25     # Monkey patch fusepy
26     FusePatches.patch_max_readahead(512)
27
28     serspeed = 19200
29
30     if len(sys.argv) - 1 < 2:
31         print('Only ' + str(len(sys.argv) - 1) + ' arguments given.')
32         print('Usage: ' + sys.argv[0] + ' <mount point> <serial device> [serial speed]')
33
34         sys.exit(-1)
35
36     if len(sys.argv) - 1 > 2:
37         serspeed = int(sys.argv[3])
38
39     link = AELinkSerial(sys.argv[2], serspeed)
40     session = AESession(link)
41     fuse = AEFuse(session)
42     FUSE(fuse, sys.argv[1], nothreads=True, foreground=True)