Skip to content

Commit

Permalink
Update path for windows compatibility + setup for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelien Besnier committed Jun 18, 2024
1 parent 69be0a5 commit b8e330f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
python -m pip install .
cd irodsgui/
pyinstaller main.py -n irodsgui --collect-all irods --collect-all irodsgui
pyinstaller main.py -n irodsgui --collect-all irods --collect-all irodsgui -w
- name: upload
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion irodsgui/globals.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# global variables file

irods_session = None
from irods.session import iRODSSession

irods_session: iRODSSession
12 changes: 6 additions & 6 deletions irodsgui/settings_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ def __init__(self, parent=None):
self.layout.addWidget(self.cancelButton, 5, 1, 1, 2)

def selectCfg(self):
self.config_location = str(QFileDialog.getOpenFileUrl(self,
"Select irods "
"configuration",
filter="config files (*.json)",
options=QFileDialog.Option.DontUseNativeDialog)[
0].toString()).removeprefix('file://')
self.config_location = QFileDialog.getOpenFileUrl(self,
"Select irods "
"configuration",
filter="config files (*.json)",
options=QFileDialog.Option.DontUseNativeDialog)[
0].toLocalFile()
print(self.config_location)

if self.config_location == "":
Expand Down
2 changes: 1 addition & 1 deletion irodsgui/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
major = 0
minor = 0
post = 5
post = 6

__version__ = ".".join([str(s) for s in (major, minor, post)])
12 changes: 10 additions & 2 deletions irodsgui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from irodsgui.version import __version__
from irods.exception import OVERWRITE_WITHOUT_FORCE_FLAG
import irodsgui.globals as glob
from irods.models import DataObject


class Window(MainWindow):
Expand All @@ -40,6 +41,7 @@ def __init__(self):
# Vars
self.root = ""
self.path = ""
self.details = []
self.folderIcon = self.style().standardIcon(
QStyle.StandardPixmap.SP_DirIcon)
self.fileIcon = self.style().standardIcon(
Expand All @@ -55,6 +57,7 @@ def login(self):
self.setStatusBarMessage("logged in", 5000)
self.root = self.settings.value('root_path')
self.path = self.root
self.details.clear()

dirs = [QListWidgetItem(self.folderIcon, '..')]
files = []
Expand All @@ -72,6 +75,10 @@ def login(self):

def detailItem(self, item):
if item.type() != 0:
print(posixpath.join(self.path, item.text()))
meta = glob.irods_session.metadata.get(
DataObject, posixpath.join(self.path, item.text()))
print(meta)
self.detailDock.updateInfo(item.text())

def onDoubleClick(self, item):
Expand All @@ -86,6 +93,7 @@ def onDoubleClick(self, item):
def changeFolder(self):
self.setStatusBarMessage(self.path)
self.listWidget.clear()
self.details.clear()

dirs = [QListWidgetItem(self.folderIcon, '..')]
files = []
Expand All @@ -108,8 +116,8 @@ def openFile(self, filepath):
os.makedirs(tmp_folder, exist_ok=True)
local_path = os.path.join(tmp_folder, os.path.basename(filepath))
try:
glob.irods_session.data_objects.get(filepath, local_path=local_path)
print(local_path)
glob.irods_session.data_objects.get(
filepath, local_path=local_path)
except OVERWRITE_WITHOUT_FORCE_FLAG:
print("file already there")
QDesktopServices.openUrl(QUrl.fromLocalFile(local_path))
Expand Down

0 comments on commit b8e330f

Please sign in to comment.