Commit 7771eb50 authored by Mark Hymers's avatar Mark Hymers Committed by Joe Lyons
Browse files

Ensure that permissions work


Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 097e496b
......@@ -4,7 +4,7 @@ import sys
import operator
import tempfile
from os import unlink, makedirs, symlink
from os import unlink, makedirs, symlink, chmod
from os.path import join, basename, dirname, exists, abspath
from glob import glob
from datetime import datetime
......@@ -14,8 +14,6 @@ import dateutil.parser
import h5py
import yias
from PyQt5 import uic
from PyQt5.QtWidgets import (QMainWindow, QApplication, QWidget, QAction,
QTableWidget, QTableWidgetItem, QVBoxLayout,
......@@ -25,7 +23,7 @@ from PyQt5.QtWidgets import (QMainWindow, QApplication, QWidget, QAction,
from PyQt5.QtGui import QIcon, QColor
from PyQt5.QtCore import pyqtSlot, QAbstractTableModel, Qt, QVariant
YIAS_PATH = dirname(yias.__file__)
YIAS_PATH = join(dirname(__file__), 'yias')
Ui_MainWindow, BaseClass_MainWindow = uic.loadUiType(join(YIAS_PATH, 'gui', 'megtransfergui.ui'))
Ui_EditDialog, BaseClass_EditDialog = uic.loadUiType(join(YIAS_PATH, 'gui', 'megeditdialog.ui'))
......@@ -309,6 +307,7 @@ class TransferApp(QMainWindow, Ui_MainWindow):
self.scanView.setModel(self.model)
self.scanView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.scanView.setSelectionMode(QAbstractItemView.ContiguousSelection)
self.scanView.setSortingEnabled(True)
self.scanView.selectionModel().selectionChanged.connect(self.UpdateSelection)
......@@ -424,6 +423,7 @@ class TransferApp(QMainWindow, Ui_MainWindow):
# Create a temporary directory
prefix = 'incoming_{}'.format(datetime.now().strftime('%Y%M%d%H%M%S'))
inc_dir = tempfile.mkdtemp(dir=self.upload_path, prefix=prefix)
chmod(inc_dir, 0o775)
raw_name = abspath(join(base_path, 'raw', filename))
if exists(raw_name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment