From 592812467da5bfe8196f16dcfa6d348551c4febd Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 9 Mar 2011 12:35:38 +1300 Subject: [PATCH] Move version constants to version.py, add version to serialized flows. For now, we don't do anything with the serialized version info, but this should give us some future-proofing for serialization format changes. --- libmproxy/__init__.py | 1 - libmproxy/flow.py | 3 ++- libmproxy/version.py | 2 ++ mitmdump | 4 +--- mitmproxy | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 libmproxy/version.py diff --git a/libmproxy/__init__.py b/libmproxy/__init__.py index 2bbcaaf53..e69de29bb 100644 --- a/libmproxy/__init__.py +++ b/libmproxy/__init__.py @@ -1 +0,0 @@ -VERSION = "0.3" diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 957d53012..dff58fa05 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -4,7 +4,7 @@ """ import subprocess, base64, sys, json, hashlib, Cookie, cookielib, copy import proxy, threading, netstring, filt -import controller +import controller, version class RunException(Exception): def __init__(self, msg, returncode, errout): @@ -230,6 +230,7 @@ class Flow: request = self.request.get_state() if self.request else None, response = self.response.get_state() if self.response else None, error = self.error.get_state() if self.error else None, + version = version.IVERSION ) if nobackup: d["backup"] = None diff --git a/libmproxy/version.py b/libmproxy/version.py new file mode 100644 index 000000000..35c6e8de8 --- /dev/null +++ b/libmproxy/version.py @@ -0,0 +1,2 @@ +IVERSION = (0, 3) +VERSION = ".".join([str(i) for i in IVERSION]) diff --git a/mitmdump b/mitmdump index 93f770609..814f2af37 100755 --- a/mitmdump +++ b/mitmdump @@ -17,9 +17,7 @@ import sys, os.path from libmproxy import proxy, dump, utils -from libmproxy import VERSION - - +from libmproxy.version import VERSION from optparse import OptionParser, OptionGroup diff --git a/mitmproxy b/mitmproxy index fed5dbac9..acc7a2bae 100755 --- a/mitmproxy +++ b/mitmproxy @@ -17,7 +17,7 @@ import sys, os.path from libmproxy import proxy, controller, console, utils -from libmproxy import VERSION +from libmproxy.version import VERSION from optparse import OptionParser, OptionGroup