Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check a valid service name has been provided #171

Merged

Commits on Nov 3, 2023

  1. Configuration menu
    Copy the full SHA
    924cd6a View commit details
    Browse the repository at this point in the history
  2. Tidy up the option parser

    - Remove some redundant parameters.
    - Construct the known_services help string separately (we'll use it
    again).
    - Exit early if no service has been specified, instead of opening a
    frontend with no service and quietly twiddling our thumbs.
    
    No attempt is made here to migrate to argparse.ArgumentParser instead of
    the deprecated optparse.OptionParser, though the 'required' argument of
    'ArgumentParser.add_argument' would obviate the need for separately
    checking whether the '--service' option has been invoked.
    benjaminhwilliams committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    7741768 View commit details
    Browse the repository at this point in the history
  3. Tidy up the service name resolution logic

    At present, a user can grow accustomed to lazily providing lower-case
    service names when invoking 'workflows.service' from the command line.
    This works fine until you encounter the following situation:
    - Known services include "DLSISPyB" and "DLSISPyBPIA";
    - user specifies '-s dlsispyb', expecting this to be interpreted as
    'DLSISPyB', or else expecting an error;
    - not finding a perfect match, the current logic checks whether any
    known service names, rendered in lower case, start with 'dlsispyb',
    finds two such matches;
    - rather than selecting either of these two matches, the program quietly
     continues to open a frontend and doesn't start any service;
    - user sees so warning or error, program twiddles its thumbs until
    terminated.
    
    New logic:
    1. Check for perfect match;
    2. Failing that, check for case-insensitive match;
    3. Failing that, check for case-sensitive partial matches.  If
    ambiguous, exit with error.
    4. Failing that, repeat 3 but now case-insensitive.
    5. If still no matches, exit with error.
    benjaminhwilliams committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    4566b15 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    41b7f9f View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Configuration menu
    Copy the full SHA
    53cb209 View commit details
    Browse the repository at this point in the history