mirror of
https://github.com/craigerl/aprsd.git
synced 2025-02-03 09:44:15 -05:00
Added standard python main()
This patch adds the standard python main() and the requisite test for the script name.
This commit is contained in:
parent
f3e386c485
commit
6ba6e14fdb
8
aprsd.py
8
aprsd.py
@ -323,6 +323,7 @@ def send_email(to_addr, content):
|
||||
|
||||
|
||||
### main() ###
|
||||
def main():
|
||||
try:
|
||||
tn = telnetlib.Telnet(HOST, 14580)
|
||||
except Exception, e:
|
||||
@ -464,7 +465,6 @@ while True:
|
||||
reply = "Unable to find you (send beacon?)"
|
||||
send_message(fromcall, reply)
|
||||
|
||||
|
||||
# USAGE
|
||||
else:
|
||||
reply = "usage: time, fortune, loc, weath, -emailaddr emailbody, -#(resend)"
|
||||
@ -481,7 +481,9 @@ while True:
|
||||
os._exit(1)
|
||||
|
||||
# end while True
|
||||
|
||||
tn.close()
|
||||
|
||||
exit()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user