當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmcvfs.Stat方法代碼示例

本文整理匯總了Python中xbmcvfs.Stat方法的典型用法代碼示例。如果您正苦於以下問題:Python xbmcvfs.Stat方法的具體用法?Python xbmcvfs.Stat怎麽用?Python xbmcvfs.Stat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xbmcvfs的用法示例。


在下文中一共展示了xbmcvfs.Stat方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: images

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def images(self):

        ''' Return a dummy image for unwanted images requests over the webservice.
            Required to prevent freezing of widget playback if the file url has no
            local textures cached yet.
        '''
        image = xbmc.translatePath("special://home/addons/plugin.video.emby/icon.png").decode('utf-8')

        self.send_response(200)
        self.send_header('Content-type', 'image/png')
        modified = xbmcvfs.Stat(image).st_mtime()
        self.send_header('Last-Modified', "%s" % modified)
        image = xbmcvfs.File(image)
        size = image.size()
        self.send_header('Content-Length', str(size))
        self.end_headers()

        self.wfile.write(image.readBytes())
        image.close() 
開發者ID:MediaBrowser,項目名稱:plugin.video.emby,代碼行數:21,代碼來源:webservice.py

示例2: file_stat

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def file_stat(path, silent=False, vfs=True):
    """
    Stat de un archivo
    @param path: ruta
    @type path: str
    @rtype: str
    @return: objeto file
    """
    path = encode(path)
    try:
        if xbmc_vfs and vfs:
            if not exists(path): return False
            return xbmcvfs.Stat(path)
        raise
    except:
        logger.error("File_Stat no soportado: %s" % path)
        if not silent:
            logger.error(traceback.format_exc())
        return False 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:21,代碼來源:filetools.py

示例3: handle_image

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def handle_image(self, image):
        '''serve image'''
        if image:
            # send single image
            try:
                ext = image.split(".")[-1]
                cherrypy.response.headers['Content-Type'] = 'image/%s' % ext
                modified = xbmcvfs.Stat(image).st_mtime()
                cherrypy.response.headers['Last-Modified'] = "%s" % modified
                image = xbmcvfs.File(image)
                cherrypy.response.headers['Content-Length'] = str(image.size())
                if cherrypy.request.method.upper() == 'GET':
                    img_data = image.readBytes()
                    image.close()
                    return str(img_data)
                else:
                    image.close()
            except Exception as exc:
                log_exception(__name__, exc)
        else:
            raise cherrypy.HTTPError(404, "No image found matching the criteria") 
開發者ID:kodi-community-addons,項目名稱:script.skin.helper.service,代碼行數:23,代碼來源:webservice.py

示例4: stat_file

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def stat_file(path):
    """Return information about a file (using xbmcvfs)"""
    from xbmcvfs import Stat
    return Stat(from_unicode(path)) 
開發者ID:emilsvennesson,項目名稱:script.module.inputstreamhelper,代碼行數:6,代碼來源:kodiutils.py

示例5: isUpdated

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def isUpdated(self, channelsLastUpdated, programLastUpdate):
        if channelsLastUpdated is None or not xbmcvfs.exists(self.xmltvFile):
            return True

        stat = xbmcvfs.Stat(self.xmltvFile)
        fileUpdated = datetime.datetime.fromtimestamp(stat.st_mtime())
        return fileUpdated > channelsLastUpdated 
開發者ID:primaeval,項目名稱:script.tvguide.fullscreen,代碼行數:9,代碼來源:source.py

示例6: _should_rotate

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def _should_rotate():
    if not _exists():
        return False
    return xbmcvfs.Stat(_get_filepath()).st_size() > _get_maxsize() 
開發者ID:rmrector,項目名稱:script.artwork.beef,代碼行數:6,代碼來源:reporting.py

示例7: get_stat

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def get_stat(path):
	return xbmcvfs.Stat(path) 
開發者ID:tvaddonsco,項目名稱:plugin.git.browser,代碼行數:4,代碼來源:vfs.py

示例8: get_size

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def get_size(path):
	return xbmcvfs.Stat(path).st_size() 
開發者ID:tvaddonsco,項目名稱:plugin.git.browser,代碼行數:4,代碼來源:vfs.py

示例9: get_mtime

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def get_mtime(path):
	return xbmcvfs.Stat(path).st_mtime() 
開發者ID:tvaddonsco,項目名稱:plugin.git.browser,代碼行數:4,代碼來源:vfs.py

示例10: get_ctime

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def get_ctime(path):
	return xbmcvfs.Stat(path).st_ctime() 
開發者ID:tvaddonsco,項目名稱:plugin.git.browser,代碼行數:4,代碼來源:vfs.py

示例11: get_atime

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def get_atime(path):
	return xbmcvfs.Stat(path).st_atime() 
開發者ID:tvaddonsco,項目名稱:plugin.git.browser,代碼行數:4,代碼來源:vfs.py

示例12: stat_file

# 需要導入模塊: import xbmcvfs [as 別名]
# 或者: from xbmcvfs import Stat [as 別名]
def stat_file(path):
    """Return information about a file (using xbmcvfs)"""
    from xbmcvfs import Stat
    return Stat(path) 
開發者ID:add-ons,項目名稱:plugin.video.vrt.nu,代碼行數:6,代碼來源:kodiutils.py


注:本文中的xbmcvfs.Stat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。