forked from XayOn/digenpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdigenpy
53 lines (44 loc) · 2 KB
/
digenpy
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
#!/usr/bin/env python
"""
Copyright (C) 2010 David Francos Cuartero
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
from Digenpy import *
import sys, Digenpy, types
if len(sys.argv) < 2:
print 'Usage: %s Country Company [Year] [Mac] [ESSID]\n %s Country To see al contrys available, and\n %s Country Company to see some company specific usage\n' %(sys.argv[0], sys.argv[0], sys.argv[0])
sys.exit(1)
if len(sys.argv) == 2:
print 'Available countries:'
for i in Digenpy.__all__:
print i
mod=getattr(Digenpy, i)
for a in dir(mod):
if isinstance(getattr(mod, a, None), types.ClassType):
help_=getattr(mod, a)('').dictionary
if help_:
if len(a) > 9: b="\t"
else: b="\t\t"
print '\t%s%s%s' %(a, b, help_)
sys.exit(1)
def printer(a_print):
if __name__ == "__main__":
if a_print.__class__ is types.ListType:
for a in a_print: print a
else:
print a_print
z=[]
module=getattr(Digenpy, sys.argv[1])
[z.append(getattr(module, sys.argv[2])) for a in dir(module)\
if isinstance(getattr(module, a, None), types.ClassType) and a in sys.argv[2].split(',') ]
[printer(i(sys.argv[2:]).dictionary) for i in z]