mirror of https://github.com/m-labs/artiq.git
devices/lda: break off main function
This commit is contained in:
parent
eb42cf2bb4
commit
87fdad97ca
|
@ -5,8 +5,7 @@ import argparse
|
|||
from artiq.management.pc_rpc import Client
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-s', '--server', default="::1",
|
||||
help="The IP address or hostname of the controller")
|
||||
|
@ -25,3 +24,6 @@ if __name__ == "__main__":
|
|||
remote.set_attenuation(args.attenuation)
|
||||
finally:
|
||||
remote.close_rpc()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
@ -165,8 +165,7 @@ class Lda:
|
|||
"""
|
||||
self.set(0x8d, bytes(chr(int(round(attenuation*4))), 'ascii'))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-d', '--device', default="LDA-102",
|
||||
choices=["LDA-102", "LDA-602", "sim"])
|
||||
|
@ -185,3 +184,6 @@ if __name__ == "__main__":
|
|||
|
||||
simple_server_loop(lda, "lda",
|
||||
args.bind, args.port)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue