| # Python interface to the Internet finger daemon. |
| # Usage: finger [options] [user][@host] ... |
| # If no host is given, the finger daemon on the local host is contacted. |
| # Options are passed uninterpreted to the finger daemon! |
| # Hardcode the number of the finger port here. |
| # It's not likely to change soon... |
| # Function to do one remote finger invocation. |
| # Output goes directly to stdout (although this can be changed). |
| s = socket(AF_INET, SOCK_STREAM) |
| s.connect((host, FINGER_PORT)) |
| # Main function: argument parsing. |
| while i < len(sys.argv) and sys.argv[i][:1] == '-': |
| options = options + sys.argv[i] + ' ' |
| at = string.index(arg, '@') |
| finger(host, options + arg) |
| # Call the main function. |