%PDF- %PDF-
Direktori : /proc/2/cwd/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/ |
Current File : //proc/2/cwd/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/file.pyc |
� �SK\c @ s3 d Z d d l m Z m Z m Z d d l Z d d l Z d Z d Z d Z d Z d Z d Z d Z d Z d � Z d d d � � YZ d e f d � � YZ d e f d � � YZ d � Z d � Z d � Z d � Z d � Z e d k r/d d l Z e e j � d k rd GHe � q/e e j d � n d S( s� Implementation of Python file objects for Mozilla/xpcom. Introduction: This module defines various class that are implemented using Mozilla streams. This allows you to open Mozilla URI's, and treat them as Python file object. Example: >>> file = URIFile("chrome://whatever") >>> data = file.read(5) # Pass no arg to read everything. Known Limitations: * Not all URL schemes will work from "python.exe" - most notably "chrome://" and "http://" URLs - this is because a simple initialization of xpcom by Python does not load up the full set of Mozilla URL handlers. If you can work out how to correctly initialize the chrome registry and setup a message queue. Known Bugs: * Only read ("r") mode is supported. Although write ("w") mode doesnt make sense for HTTP type URLs, it potentially does for file:// etc type ones. * No concept of text mode vs binary mode. It appears Mozilla takes care of this internally (ie, all "text/???" mime types are text, rest are binary) i����( t componentst Exceptiont _xpcomNi i i i i i i@ i� c C sp t j d j t j j � } | j | � t j d j t j j � } | j | � j t j j � } | | _ | S( s1 Convert a filename to an XPCOM nsIFileURL object.s @mozilla.org/file/local;1s! @mozilla.org/network/io-service;1( R t classest createInstancet interfacest nsILocalFilet initWithPatht getServicet nsIIOServicet newFileURIt queryInterfacet nsIFileURLt file( t localFileNamet localFilet io_servicet url( ( s; /usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/file.pyt LocalFileToURLN s t _Filec B sb e Z d d d � Z d � Z d � Z d � Z d d � Z d � Z d � Z d � Z d � Z RS( t rc C sB t j � | _ d | _ | _ | d k r>