Exemplo n.º 1
0
def getRequestConfig_LastOpen():
    viewerConfig = getRequestConfig()
    if "last_open" in viewerConfig:
        return viewerConfig["last_open"]
    else:
        viewerConfig["last_open"] = PFunction.getUserFolder()
        return PFunction.getUserFolder()
Exemplo n.º 2
0
    def __init__(self):
        super().__init__()
        self.setStyleSheet("""QWidget{
                                background: white;
                                border-radius: 10px;
                                }
                                QWidget:hover{
                                background:#ece1dd;
                                }""")

        self.title = QLabel()
        self.title.setAlignment(Qt.AlignTop | Qt.AlignLeft)
        self.title.setStyleSheet("""QLabel{
                                    border: none;
                                    color: #424242;
                                    background: transparent;
                                    font-weight: bold;
                                    font-size: 12px;
                                    }""")
        self.title.setWordWrap(True)
        self.title.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        layout = QVBoxLayout()
        layout.setAlignment(Qt.AlignTop | Qt.AlignLeft)
        layout.addWidget(self.title)
        self.setLayout(layout)
        PFunction.applyShadow(self)

        self.titleText = ""
        self.onItemClick = None
Exemplo n.º 3
0
def getConfig():
    if os.path.isfile(getConfigFile()):
        try:
            data = open(getConfigFile(), "r", encoding="utf-8").read()
            obj = json.loads(data)
            return obj
        except Exception as ex:
            logging.exception(ex)
    return {
        "viewer": {
            "last_open": PFunction.getUserFolder()
        },
        "request": {
            "last_open": PFunction.getUserFolder()
        }
    }
Exemplo n.º 4
0
def getRequestConfig():
    config = getConfig()

    if "request" in config:
        return config["request"]
    else:
        config["request"] = {"last_open": PFunction.getUserFolder()}
        return config["request"]
Exemplo n.º 5
0
def getViewerConfig():
    config = getConfig()

    if "viewer" in config:
        return config["viewer"]
    else:
        config["viewer"] = {"last_open": PFunction.getUserFolder()}
        return config["viewer"]
Exemplo n.º 6
0
def getDataFolder():
    path = os.path.join(PFunction.getUserFolder(), "XuCompa")
    if not os.path.isdir(path):
        PFunction.linux_mkdir(PFunction.getUserFolder(), path, "XuCompa")

    p2 = os.path.join(path, "XRequest")
    if not os.path.isdir(p2):
        PFunction.linux_mkdir(path, p2, "XRequest")
    return p2
Exemplo n.º 7
0
def getRequestFolder():
    path = os.path.join(getDataFolder(), "Request")
    if not os.path.isdir(path):
        PFunction.linux_mkdir(getDataFolder(), path, "Request")
    return path, os.path.join(path, "description.xdef")