diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index e088cb1..c199f60 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -46,7 +46,7 @@ jobs: - name: Extract Commit Number id: extract_commit shell: bash - run: echo "commits=$(git rev-list --count ${{ steps.extract_branch.outputs.branch }})" >>$GITHUB_OUTPUT + run: echo "commits=$(( $(git rev-list --count $(git rev-parse --abbrev-ref HEAD)) + 1))" >>$GITHUB_OUTPUT - name: Create GitHub Release id: create_release uses: actions/create-release@v1 diff --git a/.gitignore b/.gitignore index 63e603a..fec5e21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Development +data/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/app.py b/app.py index 262d3d1..7f312ef 100644 --- a/app.py +++ b/app.py @@ -85,9 +85,12 @@ def __init__(self): self.dock_folders = QDockWidget("Folders") self.dock_folders.setWidget(self.folders) self.fileSystem = QFileSystemModel() - self.fileSystem.setRootPath("") + self.folder_path = os.getcwd().replace("\\", '/') + "/data/folders/" + os.makedirs(self.folder_path, exist_ok=True) + self.fileSystem.setRootPath(self.folder_path) self.fileSystem.setFilter(QDir.Filter.Dirs | QDir.Filter.NoDotAndDotDot) self.folders.setModel(self.fileSystem) + self.folders.setRootIndex(self.fileSystem.index(self.folder_path)) self.folders.setHeaderHidden(True) for column in range(1, self.fileSystem.columnCount()): self.folders.setColumnHidden(column, True) @@ -143,6 +146,11 @@ def __init__(self): def add_folder(self): path = QFileDialog.getExistingDirectory(self, "Select Folder to Add to View", os.path.expanduser("~")) + target = self.folder_path + os.path.basename(path) + if os.path.exists(target): + self.status.showMessage(f"Folder already exists - {path}") + return + os.symlink(path, target, target_is_directory=True) self.status.showMessage(f"Added - {path}") def open_file(self): # DEV