examples/collect_config_files.py
def store_version(version_path_name, config_file_version):
    """
    Store the given config file version into the local filesystem.
    Each version goes under a separate directory and it contains a MANIFEST.mf
    file in addition to the file which has the configuration text.
    """
    try:
        # Create the directory for this version
        os.makedirs(os.path.abspath(version_path_name))
    except OSError as exception:
        if exception.errno != errno.EEXIST:
            raise

    #
    # Create a MANIFEST.mf file with details about this version
    #
    mf_name = '/'.join([version_path_name, 'MANIFEST.mf'])
    with open(os.path.abspath(mf_name), 'w') as f:
        f.write('Version Id: %s\n' % str(config_file_version.versionId))
        f.write('Config File Size: %s\n' % \
                str(config_file_version.configFileSize))
        f.write('MD5: %s\n' % str(config_file_version.latestMD5))
        f.write('Creation Time: %s\n' % str(config_file_version.creationTime))
        f.write('Comment: %s\n' % str(config_file_version.comment))

    #
    # Store the configuration text contents for this version into a file.
    # The name of the file is as given by Space and consists of the device
    # name, version id, and creation time stamp.
    #
    contents_file_name = '/'.join([version_path_name,
                                   str(config_file_version.fileName)])
    with open(os.path.abspath(contents_file_name), 'w') as f:
        f.write(config_file_version.content.text)

    Store the given config file version into the local filesystem.
    Each version goes under a separate directory and it contains a MANIFEST.mf
    file in addition to the file which has the configuration text.
    
Store the given config file version into the local filesystem.
Each version goes under a separate directory and it contains a MANIFEST.mf
file in addition to the file which has the configuration text.
Store the given config file version into the local filesystem . Each version goes under a separate directory and it contains a MANIFEST . mf file in addition to the file which has the configuration text .
def store_version(version_path_name, config_file_version):
    try:
        os.makedirs(os.path.abspath(version_path_name))
    except OSError as exception:
        if exception.errno != errno.EEXIST:
            raise
     Create a MANIFEST.mf file with details about this version
    mf_name = '/'.join([version_path_name, 'MANIFEST.mf'])
    with open(os.path.abspath(mf_name), 'w') as f:
        f.write('Version Id: %s\n' % str(config_file_version.versionId))
        f.write('Config File Size: %s\n' % \
                str(config_file_version.configFileSize))
        f.write('MD5: %s\n' % str(config_file_version.latestMD5))
        f.write('Creation Time: %s\n' % str(config_file_version.creationTime))
        f.write('Comment: %s\n' % str(config_file_version.comment))
     Store the configuration text contents for this version into a file.
     The name of the file is as given by Space and consists of the device
     name, version id, and creation time stamp.
    contents_file_name = '/'.join([version_path_name,
                                   str(config_file_version.fileName)])
    with open(os.path.abspath(contents_file_name), 'w') as f:
        f.write(config_file_version.content.text)
def store_version ( version_path_name , config_file_version ) : try : os . makedirs ( os . path . abspath ( version_path_name ) ) except OSError as exception : if exception . errno != errno . EEXIST : raise mf_name = '/' . join ( [ version_path_name , 'MANIFEST.mf' ] ) with open ( os . path . abspath ( mf_name ) , 'w' ) as f : f . write ( 'Version Id: %s\n' % str ( config_file_version . versionId ) ) f . write ( 'Config File Size: %s\n' % str ( config_file_version . configFileSize ) ) f . write ( 'MD5: %s\n' % str ( config_file_version . latestMD5 ) ) f . write ( 'Creation Time: %s\n' % str ( config_file_version . creationTime ) ) f . write ( 'Comment: %s\n' % str ( config_file_version . comment ) ) contents_file_name = '/' . join ( [ version_path_name , str ( config_file_version . fileName ) ] ) with open ( os . path . abspath ( contents_file_name ) , 'w' ) as f : f . write ( config_file_version . content . text )
Store the given config file version into the local filesystem.
Store the given config file version into the local filesystem .
"""
    Store the given config file version into the local filesystem.
    Each version goes under a separate directory and it contains a MANIFEST.mf
    file in addition to the file which has the configuration text.
    """ # Create the directory for this version # # Create a MANIFEST.mf file with details about this version # # # Store the configuration text contents for this version into a file. # The name of the file is as given by Space and consists of the device # name, version id, and creation time stamp. #
version_path_name
config_file_version