[chirp_devel] [PATCH] [(py2) default branch] Chirp control of start-directory and last-directory - completes #8675

Dan Smith
Thu Feb 11 14:21:22 PST 2021


Sorry for the delay in processing this.

> # HG changeset patch
> # User Rudolph Gutzerhagen <rudolph.gutzerhagen at gmail.com>
> # Date 1610683906 18000
> #      Thu Jan 14 23:11:46 2021 -0500
> # Node ID 331b3ae7103677deaf7eac5ed7b613a5e3573b8f
> # Parent  786c6252a1edeea27e66a22cc028b8f4b42bb964
> Tune up start-directory and last-directory behaviour, particularly for
> Chirp on Windows.  This change is relatively benign for the user's
> perspective.

This also needs a bug reference according to our process.

> -            fname, _, _ = win32gui.GetOpenFileNameW(Filter=typestrs)
> +            if not start_dir:
> +                fname, _, _ = win32gui.GetOpenFileNameW(Filter=typestrs)
> +            else:
> +                try:
> +                    # set environment variable with start-directory
> +                    os.environ['opentodir'] = start_dir
> +                except Exception, e:
> +                    LOG.error("Failed to set environment opentodir: %s" % e)
> +                    return None
> +                fname, _, _ = win32gui.GetOpenFileNameW(
> +                    Filter=typestrs, InitialDir=os.environ['opentodir'])

Why are you storing this in the environment, only to fetch it back yourself a few lines later?

--Dan


More information about the chirp_devel mailing list