%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/vdo/utils/ |
Current File : //lib/python2.7/site-packages/vdo/utils/FileUtils.pyc |
� .�t_c @ s' d Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z e j d � d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( s� FileUtils - Provides dmmgmnt file-related capabilities. $Id: //eng/vdo-releases/magnesium/src/python/vdo/utils/FileUtils.py#1 $ i����( t print_functionNi ( t Command( t Timeoutt TimeoutErrort utilst FileBasec B sh e Z d Z e j d � Z e d � � Z d � Z d � Z d � Z e d � � Z e j d � � Z RS( s� The FileBase object; provides basic file control. Class attributes: log (logging.Logger) - logger for this class Attributes: None s utils.FileBasec C s | j S( N( t _FileBase__filePath( t self( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyt path: s c O sA t t | � j � t j j | � | _ | j d d � | _ d S( s: Arguments: None Returns: Nothing t fdN( t superR t __init__t osR t realpathR t gett Nonet _FileBase__fd( R t filePatht argst kwargs( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR A s c C s | S( N( ( R ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyt __enter__M s c C s t S( N( t False( R t exceptionTypet exceptionValuet traceback( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyt __exit__Q s c C s | j S( N( R ( R ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyt _fdX s c C s | | _ d S( N( R ( R t value( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR _ s ( t __name__t __module__t __doc__t loggingt getLoggert logt propertyR R R R R t setter( ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR - s t FileTouchc B s8 e Z d Z e j d � Z d � Z d � Z d � Z RS( s� The FileTouch object; touches the file. Class attributes: log (logging.Logger) - logger for this class Attributes: None s utils.FileTouchc O s t t | � j | | | � d S( s: Arguments: None Returns: Nothing N( R R$ R ( R R R R ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR y s c C s� t t | � j � | j d k r� t j j | j � } t j | t j � sn t d d | g � } | j � n t j | j t j � s� | j � q� n | S( s0 Make certain the file exists and return ourself.t mkdirs -pN( R R$ R R R R R t dirnamet accesst F_OKR t runt _createFile( R t dirPatht cmd( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR � s c C s# t d | j g � } | j � d S( s Creates the targe file.t touchN( R R R) ( R R, ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR* � s ( R R R R R R! R R R* ( ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR$ h s t FileOpenc B s� e Z d Z e j d � Z e d � � Z d � Z d d � Z d d � Z d d � Z e j d � Z d d � Z d � Z d � Z d � Z d � Z d � Z d d � Z d � Z e d � � Z RS( s� The FileOpen object; provides basic access to a file. Class attributes: log (logging.Logger) - logger for this class Attributes: None s utils.FileOpenc C s | j S( N( t _FileOpen__file( R ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyt file� s c C s | j j � d S( N( R0 t flush( R ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR1 � s i����c C s | j j | � S( N( R0 t read( R t numberOfBytes( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR2 � s c C s | j j | � S( N( R0 t readline( R R3 ( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR4 � s c C s- | d k r | j j � S| j j | � Sd S( N( R R0 t readlines( R t numberOfBytesHint( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR5 � s c C s | j j | | � d S( N( R0 t seek( R t offsett whence( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR7 � s c C s0 | d k r | j j � n | j j | � d S( N( R R0 t truncate( R t size( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR: � s c C s | j j | � d S( N( R0 t write( R t string( ( s7 /usr/lib/python2.7/site-packages/vdo/utils/FileUtils.pyR<