-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.py
More file actions
62 lines (54 loc) · 1.44 KB
/
test.py
File metadata and controls
62 lines (54 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# from defusedxml.ElementTree import parse
#
# tree = parse('textXML.xml')
# root = tree.getroot()
# loginResponse = root.get('success')
# if (loginResponse == 1):
# self.session_id = root.get('session-id')
# else:
# fa = root.find('Failure')
# ex = fa.find('Exception')
# msg = ex.find('message').text
# print('\033[93m' + "Login Failure: " + msg + '\033[0m')
# from util import Utilities
#
#
#
# import string
# import random
#
#
# def gen_code(size=16, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
# return ''.join(random.SystemRandom().choice(chars) for _ in range(size))
#
# Utilities.printError(gen_code())
# msg = "outside\nnew\n"
#
# if True:
# msg += "insideZZZZ121212ZZ"
#
# f = open('User_details_toMail.txt', 'w')
# f.writ
#
#
# from StringIO import StringIO
# from lxml import etree
#
# dtd = etree.DTD(StringIO("""<!ELEMENT foo EMPTY>"""))
# root = etree.XML("<foo/>")
# print(dtd.validate(root))
# # True
#
# root = etree.XML("<foo>bar</foo>")
# print(dtd.validate(root))
# # False
# print(dtd.error_log.filter_from_errors())
# # <string>:1:0:ERROR:VALID:DTD_NOT_EMPTY: Element foo was declared EMPTY this one has content
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("action",help="Scanner tasks to perform", choices=['adduser','scan'])
args = parser.parse_args()
if args.action == 'adduser':
print("adduser")
if args.action == 'scan':
print("scan")