@@ -1,35 +1,35 | |||||
1 | import optparse, os, sys |
|
1 | import optparse, os, sys | |
2 |
|
2 | |||
3 | pathFile = os.path.dirname(os.path.abspath(__file__)) |
|
3 | pathFile = os.path.dirname(os.path.abspath(__file__)) | |
4 | sys.path.append(os.path.split(pathFile)[0]) |
|
4 | sys.path.append(os.path.split(pathFile)[0]) | |
5 |
|
5 | |||
6 | from bin.client3 import ABSClient |
|
6 | from bin.client3 import ABSClient | |
7 |
|
7 | |||
8 | class changeBeam(object): |
|
8 | class changeBeam(object): | |
9 |
|
9 | |||
10 | def __init__(self): |
|
10 | def __init__(self): | |
11 | self.output = "" |
|
11 | self.output = "" | |
12 |
|
12 | |||
13 | def execute(self, beam="0"): |
|
13 | def execute(self, beam="0"): | |
14 |
|
|
14 | absObj = ABSClient(ipDestino="10.10.10.97") | |
15 | absObj = ABSClient(ipDestino="10.10.20.27") |
|
15 | #absObj = ABSClient(ipDestino="10.10.20.27") | |
16 | self.output = absObj.changeBeam(beam) |
|
16 | self.output = absObj.changeBeam(beam) | |
17 |
|
17 | |||
18 | def getOutput(self): |
|
18 | def getOutput(self): | |
19 | return self.output |
|
19 | return self.output | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | usage = "::::::::::::\n" |
|
22 | usage = "::::::::::::\n" | |
23 |
|
23 | |||
24 | if __name__ == '__main__': |
|
24 | if __name__ == '__main__': | |
25 |
|
25 | |||
26 | parser = optparse.OptionParser(usage=usage) |
|
26 | parser = optparse.OptionParser(usage=usage) | |
27 |
|
27 | |||
28 | parser.add_option("-n", "--beam", dest="pattern", type="string", default="0", help="Number of Pattern") |
|
28 | parser.add_option("-n", "--beam", dest="pattern", type="string", default="0", help="Number of Pattern") | |
29 |
|
29 | |||
30 | (options, args) = parser.parse_args() |
|
30 | (options, args) = parser.parse_args() | |
31 |
|
31 | |||
32 | beam = options.pattern |
|
32 | beam = options.pattern | |
33 |
|
33 | |||
34 | app = changeBeam() |
|
34 | app = changeBeam() | |
35 | app.execute(beam) |
|
35 | app.execute(beam) |
@@ -1,13 +1,16 | |||||
1 | import file |
|
1 | import optparse, os, sys | |
2 | from client3 import * |
|
|||
3 | import sys |
|
|||
4 |
|
2 | |||
5 | absObj = ABSClient(ipDestino="10.10.10.99") |
|
3 | pathFile = os.path.dirname(os.path.abspath(__file__)) | |
|
4 | sys.path.append(os.path.split(pathFile)[0]) | |||
|
5 | ||||
|
6 | from bin.client3 import ABSClient | |||
|
7 | ||||
|
8 | absObj = ABSClient(ipDestino="10.10.10.97") | |||
6 | #absObj = ABSClient(ipDestino="10.10.20.27") |
|
9 | #absObj = ABSClient(ipDestino="10.10.20.27") | |
7 | #absObj = ABSClient() |
|
10 | #absObj = ABSClient() | |
8 | if len(sys.argv) == 2: |
|
11 | if len(sys.argv) == 2: | |
9 | # ns = "4" |
|
12 | # ns = "4" | |
10 | arg = sys.argv[1] |
|
13 | arg = sys.argv[1] | |
11 | absObj.getControlModuleStatus_test(arg) |
|
14 | absObj.getControlModuleStatus_test(arg) | |
12 | else: |
|
15 | else: | |
13 | print "Only one argument needed." |
|
16 | print "Only one argument needed." |
@@ -1,39 +1,39 | |||||
1 |
|
1 | |||
2 | import optparse, os, sys |
|
2 | import optparse, os, sys | |
3 |
|
3 | |||
4 | pathFile = os.path.dirname(os.path.abspath(__file__)) |
|
4 | pathFile = os.path.dirname(os.path.abspath(__file__)) | |
5 | sys.path.append(os.path.split(pathFile)[0]) |
|
5 | sys.path.append(os.path.split(pathFile)[0]) | |
6 |
|
6 | |||
7 | from bin.client3 import ABSClient |
|
7 | from bin.client3 import ABSClient | |
8 |
|
8 | |||
9 | class sendFile(object): |
|
9 | class sendFile(object): | |
10 |
|
10 | |||
11 | def __init__(self): |
|
11 | def __init__(self): | |
12 | self.output = "" |
|
12 | self.output = "" | |
13 |
|
13 | |||
14 | def execute(self, filename): |
|
14 | def execute(self, filename): | |
15 | if os.path.exists(filename): |
|
15 | if os.path.exists(filename): | |
16 | #absObj = ABSClient(ipDestino="10.10.10.97") |
|
16 | #absObj = ABSClient(ipDestino="10.10.10.97") | |
17 |
absObj = ABSClient(ipDestino="10.10. |
|
17 | absObj = ABSClient(ipDestino="10.10.10.97") | |
18 | self.output = absObj.sendFile(filename) |
|
18 | self.output = absObj.sendFile(filename) | |
19 | #pass |
|
19 | #pass | |
20 | else: |
|
20 | else: | |
21 | print "No file" |
|
21 | print "No file" | |
22 |
|
22 | |||
23 | def getOutput(self): |
|
23 | def getOutput(self): | |
24 | return self.output |
|
24 | return self.output | |
25 |
|
25 | |||
26 | usage = "::::::::::::\n" |
|
26 | usage = "::::::::::::\n" | |
27 |
|
27 | |||
28 | if __name__ == '__main__': |
|
28 | if __name__ == '__main__': | |
29 |
|
29 | |||
30 | parser = optparse.OptionParser(usage=usage) |
|
30 | parser = optparse.OptionParser(usage=usage) | |
31 |
|
31 | |||
32 | parser.add_option("-f", "--filename", dest="filename", type="string", default="", help="Filename") |
|
32 | parser.add_option("-f", "--filename", dest="filename", type="string", default="", help="Filename") | |
33 |
|
33 | |||
34 | (options, args) = parser.parse_args() |
|
34 | (options, args) = parser.parse_args() | |
35 |
|
35 | |||
36 | filename = options.filename |
|
36 | filename = options.filename | |
37 |
|
37 | |||
38 | app = sendFile() |
|
38 | app = sendFile() | |
39 | app.execute(filename) |
|
39 | app.execute(filename) |
General Comments 0
You need to be logged in to leave comments.
Login now