summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2015-02-21 21:42:28 +0100
committerYves Fischer <yvesf-git@xapek.org>2015-02-21 21:42:28 +0100
commit4da5111224a7aa00a07dd4fdb2bca98687291532 (patch)
tree8153613db7ee51e49e007aa4367c2de3593fd5f1
parent177325a8f1b4fb6130d868a368ac8a2c8165b997 (diff)
downloadfuse-httpfs-4da5111224a7aa00a07dd4fdb2bca98687291532.tar.gz
fuse-httpfs-4da5111224a7aa00a07dd4fdb2bca98687291532.zip
remove argparse from package
-rw-r--r--httpfs/__init__.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/httpfs/__init__.py b/httpfs/__init__.py
index 518bcc5..f0359e3 100644
--- a/httpfs/__init__.py
+++ b/httpfs/__init__.py
@@ -292,39 +292,3 @@ class Httpfs(fuse.LoggingMixIn, fuse.Operations):
return entry.get(size, offset)
else:
raise fuse.FuseOSError(EIO)
-
-if __name__ == '__main__':
- import argparse
- FORMAT = "%(threadName)s %(asctime)-15s %(levelname)s:%(name)s %(message)s"
- logging.basicConfig(level=logging.INFO, format=FORMAT)
-
- p = argparse.ArgumentParser(
- formatter_class=argparse.ArgumentDefaultsHelpFormatter)
- p.add_argument("mountpoint", nargs=1, help="Target directory")
- p.add_argument("--max_background", type=int, default=15,
- help="Maximum number of background threads")
- p.add_argument("--no_foreground", action="store_true", default=False,
- help="Fork into background as a daemon")
- p.add_argument("--debug", action="store_true", help="Enable fuse debug")
- p.add_argument("--nothreads", action="store_true",
- help="Disable fuse threads")
- p.add_argument("--connect_timeout", type=int, default=Config.timeout[0],
- help="HTTP connect timeout")
- p.add_argument("--read_timeout", type=int, default=Config.timeout[1],
- help="HTTP read timeout")
- p.add_argument("--no-verify", action="store_true",
- help="Disable ssl verify")
-
- args = vars(p.parse_args(sys.argv[1:]))
-
- Config.timeout = (args.pop("connect_timeout"), args.pop("read_timeout"))
- Config.mountpoint = args.pop("mountpoint")[0]
- Config.verify = not args.pop("no_verify")
- kwargs = {}
- if not args.pop("no_foreground"):
- kwargs["foreground"] = True
- if args.pop("debug"):
- kwargs["debug"] = True
- kwargs.update(args)
-
- fuse = fuse.FUSE(Httpfs(), Config.mountpoint, **kwargs)