Skip to content

Permit profile creation in existing directory #37

@rpanderson

Description

@rpanderson

Profile creation fails if pathlib.Path.home() / 'labscript-suite' exists.

~/labscript-suite$ labscript-profile-create
Traceback (most recent call last):
  File "/home/rpanderson/labscript-suite/.venv/bin/labscript-profile-create", line 11, in <module>
    load_entry_point('labscript-utils==2.16.0.dev3', 'console_scripts', 'labscript-profile-create')()
  File "/home/rpanderson/labscript-suite/.venv/lib/python3.7/site-packages/labscript_profile/create.py", line 41, in create_profile
    raise FileExistsError(LABSCRIPT_SUITE_PROFILE)

This proposal is to permit existence of pathlib.Path.home() / 'labscript-suite', but:

  1. not if any files of the same name as those in DEFAULT_PROFILE_CONTENTS exist; or, alternatively
  2. not if directories of the same name as those in DEFAULT_PROFILE_CONTENTS exist.

This would permit–at least–installing a virtual environment and/or a local install of the suite in pathlib.Path.home() / 'labscript-suite'.

For (1) above, the dirs_exist_ok parameter of shutil.copytree could be used, but this requires python_version >= '3.8'.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy