示例#1
0
 def databasePath(self):
     """
     Return the path to the database.
     
     :rtype: str 
     """
     return studiolibrary.formatPath(self.DatabasePath, path=self.path())
 def databasePath(self):
     """
     Return the path to the database.
     
     :rtype: str 
     """
     formatString = studiolibrary.config().get('databasePath')
     return studiolibrary.formatPath(formatString, path=self.path())
示例#3
0
def settingsPath():
    """
    Get the settings path from the config file.
    
    :rtype: str 
    """
    formatString = studiolibrary.config.get('settingsPath')
    return studiolibrary.formatPath(formatString)
示例#4
0
    def settingsPath(self):
        """
        Get the settings path for the LibraryWindow.

        :rtype: str
        """
        formatString = studiolibrary.config().get('settingsPath')
        return studiolibrary.formatPath(formatString)
示例#5
0
 def databasePath(self):
     """
     Return the path to the database.
     
     :rtype: str 
     """
     formatString = studiolibrary.config().get('databasePath')
     return studiolibrary.formatPath(formatString, path=self.path())
示例#6
0
def settingsPath():
    """
    Get the settings path from the config file.
    
    :rtype: str 
    """
    formatString = studiolibrary.config().get('settingsPath')
    return studiolibrary.formatPath(formatString)
示例#7
0
    def metaPath(self):
        """
        Return the meta path on disc for the item.

        :rtype: str
        """
        path = self.META_PATH
        return studiolibrary.formatPath(self.path(), path)
示例#8
0
 def readMetadata(self):
     """
     Read the metadata for the item from disc.
     
     :rtype: dict
     """
     formatString = studiolibrary.config().get('metadataPath')
     path = studiolibrary.formatPath(formatString, self.path())
     metadata = studiolibrary.readJson(path)
     return metadata
示例#9
0
 def saveMetadata(self, metadata):
     """
     Save the given metadata to disc.
     
     :type metadata: dict
     """
     formatString = studiolibrary.config().get('metadataPath')
     path = studiolibrary.formatPath(formatString, self.path())
     studiolibrary.saveJson(path, metadata)
     self.setMetadata(metadata)
示例#10
0
 def readMetadata(self):
     """
     Read the metadata for the item from disc.
     
     :rtype: dict
     """
     formatString = studiolibrary.config().get('metadataPath')
     path = studiolibrary.formatPath(formatString, self.path())
     metadata = studiolibrary.readJson(path)
     return metadata
示例#11
0
 def saveMetadata(self, metadata):
     """
     Save the given metadata to disc.
     
     :type metadata: dict
     """
     formatString = studiolibrary.config().get('metadataPath')
     path = studiolibrary.formatPath(formatString, self.path())
     studiolibrary.saveJson(path, metadata)
     self.setMetadata(metadata)
示例#12
0
 def saveMetadata(self, metadata):
     """
     Save the given metadata to disc.
     
     :type metadata: dict
     """
     formatString = studiolibrary.config.get('metadataPath')
     path = studiolibrary.formatPath(formatString, self.path())
     studiolibrary.saveJson(path, metadata)
     self.setMetadata(metadata)
     self.syncItemData(emitDataChanged=False)
     self.dataChanged.emit(self)
示例#13
0
    def readMetadata(self):
        """
        Read the metadata for the item from disc.
        
        :rtype: dict
        """
        if self._metadata is None:
            formatString = studiolibrary.config.get('metadataPath')
            path = studiolibrary.formatPath(formatString, self.path())

            if os.path.exists(path):
                self._metadata = studiolibrary.readJson(path)
            else:
                self._metadata = {}

        return self._metadata