We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4116d07 commit b3d52d0Copy full SHA for b3d52d0
datasploit_config.py
@@ -0,0 +1,28 @@
1
+#!/usr/bin/env python
2
+
3
+import os, subprocess, tempfile
4
5
+def edit():
6
+ config_path = os.path.dirname(__file__)
7
+ config_file = "%s/config.py" % config_path
8
+ fh = open(config_file)
9
+ config = fh.read()
10
+ fh.close()
11
+ f, fname = tempfile.mkstemp()
12
+ fh = open(fname, "w")
13
+ fh.write(config)
14
15
16
+ cmd = os.environ.get('EDITOR', 'vi') + ' ' + fname
17
+ subprocess.call(cmd, shell = True)
18
19
+ with open(fname, "r") as f:
20
+ config = f.read().strip()
21
+ fh = open(config_file, "w")
22
23
24
25
+ os.unlink(fname)
26
27
+if __name__ == "__main__":
28
+ edit()
0 commit comments