Permalink
Browse files

Replace configargparse with argparse, enable new options loading

This commit ditches configargparse and enables the new config file format. The
default location is ~/.mitmproxy/config.yaml. Unifying all of the various
Options objects will follow in the next patch.
  • Loading branch information...
1 parent 6aacd27 commit d742d4fb8c8d601c19f7aa5ff746a4167d864f7e @cortesi committed Dec 5, 2016
Showing with 126 additions and 122 deletions.
  1. +1 −1 .gitignore
  2. +1 −0 mitmproxy/optmanager.py
  3. +4 −3 mitmproxy/platform/windows.py
  4. +73 −95 mitmproxy/tools/cmdline.py
  5. +45 −21 mitmproxy/tools/main.py
  6. +0 −1 setup.py
  7. +2 −1 test/mitmproxy/test_proxy.py
View
@@ -1,6 +1,6 @@
.DS_Store
MANIFEST
-*/tmp
+**/tmp
/venv*
*.py[cdo]
*.swp
@@ -238,6 +238,7 @@ def load_paths(self, *paths):
OptionsError.
"""
for p in paths:
+ p = os.path.expanduser(p)
if os.path.exists(p) and os.path.isfile(p):
txt = open(p, "r").read()
self.load(txt)
@@ -7,7 +7,7 @@
import threading
import time
-import configargparse
+import argparse
import pydivert
import pydivert.consts
import pickle
@@ -386,8 +386,9 @@ def response(self):
if __name__ == "__main__":
- parser = configargparse.ArgumentParser(
- description="Windows Transparent Proxy")
+ parser = argparse.ArgumentParser(
+ description="Windows Transparent Proxy"
+ )
parser.add_argument(
'--mode',
choices=[
Oops, something went wrong.

0 comments on commit d742d4f

Please sign in to comment.