#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul  9 17:48:56 2018

@author: Martin Braquet
"""

import os
import sys
import yaml

# Absolute path to the config file
CONFIG_FILE_NAME = '/home/martin/Documents/Syntheses/src/config.yml'    
            
def main():
    quadri = int(sys.argv[1])
    name = sys.argv[2]
    option = sys.argv[3]
    code = int(sys.argv[4])
    typ = sys.argv[5]
    with open(CONFIG_FILE_NAME, 'r') as stream:
        document = yaml.load(stream)
        stream.close()
        
        cycle = document['clients'][0]['output']['parameters'][0]['parameters'][0]['mapping'][quadri]
        option_map = document['clients'][0]['output']['parameters'][0]['parameters'][1]['mapping'][option]
        titre = document['clients'][0]['output']['parameters'][0]['parameters'][5]['mapping'][name]
        if typ == 'exam' or typ == 'test':
            year = int(sys.argv[6])
            month = sys.argv[7]
            type_map = document['clients'][1]['output']['parameters'][1]['mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map + '/' + str(year) + '_' + month.title()
        else:
            type_map = document['clients'][0]['output']['parameters'][1]['mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map
    
    print(out_path)
            
if __name__ == "__main__":
    main()
f597ad20766460c4ef9e9e053de19e4566ea8842
<mask token>


def main():
    quadri = int(sys.argv[1])
    name = sys.argv[2]
    option = sys.argv[3]
    code = int(sys.argv[4])
    typ = sys.argv[5]
    with open(CONFIG_FILE_NAME, 'r') as stream:
        document = yaml.load(stream)
        stream.close()
        cycle = document['clients'][0]['output']['parameters'][0]['parameters'
            ][0]['mapping'][quadri]
        option_map = document['clients'][0]['output']['parameters'][0][
            'parameters'][1]['mapping'][option]
        titre = document['clients'][0]['output']['parameters'][0]['parameters'
            ][5]['mapping'][name]
        if typ == 'exam' or typ == 'test':
            year = int(sys.argv[6])
            month = sys.argv[7]
            type_map = document['clients'][1]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code
                ) + ' - ' + titre + '/' + type_map + '/' + str(year
                ) + '_' + month.title()
        else:
            type_map = document['clients'][0]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map
    print(out_path)


<mask token>

<mask token>


def main():
    quadri = int(sys.argv[1])
    name = sys.argv[2]
    option = sys.argv[3]
    code = int(sys.argv[4])
    typ = sys.argv[5]
    with open(CONFIG_FILE_NAME, 'r') as stream:
        document = yaml.load(stream)
        stream.close()
        cycle = document['clients'][0]['output']['parameters'][0]['parameters'
            ][0]['mapping'][quadri]
        option_map = document['clients'][0]['output']['parameters'][0][
            'parameters'][1]['mapping'][option]
        titre = document['clients'][0]['output']['parameters'][0]['parameters'
            ][5]['mapping'][name]
        if typ == 'exam' or typ == 'test':
            year = int(sys.argv[6])
            month = sys.argv[7]
            type_map = document['clients'][1]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code
                ) + ' - ' + titre + '/' + type_map + '/' + str(year
                ) + '_' + month.title()
        else:
            type_map = document['clients'][0]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map
    print(out_path)


if __name__ == '__main__':
    main()

<mask token>
CONFIG_FILE_NAME = '/home/martin/Documents/Syntheses/src/config.yml'


def main():
    quadri = int(sys.argv[1])
    name = sys.argv[2]
    option = sys.argv[3]
    code = int(sys.argv[4])
    typ = sys.argv[5]
    with open(CONFIG_FILE_NAME, 'r') as stream:
        document = yaml.load(stream)
        stream.close()
        cycle = document['clients'][0]['output']['parameters'][0]['parameters'
            ][0]['mapping'][quadri]
        option_map = document['clients'][0]['output']['parameters'][0][
            'parameters'][1]['mapping'][option]
        titre = document['clients'][0]['output']['parameters'][0]['parameters'
            ][5]['mapping'][name]
        if typ == 'exam' or typ == 'test':
            year = int(sys.argv[6])
            month = sys.argv[7]
            type_map = document['clients'][1]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code
                ) + ' - ' + titre + '/' + type_map + '/' + str(year
                ) + '_' + month.title()
        else:
            type_map = document['clients'][0]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map
    print(out_path)


if __name__ == '__main__':
    main()

<mask token>
import os
import sys
import yaml
CONFIG_FILE_NAME = '/home/martin/Documents/Syntheses/src/config.yml'


def main():
    quadri = int(sys.argv[1])
    name = sys.argv[2]
    option = sys.argv[3]
    code = int(sys.argv[4])
    typ = sys.argv[5]
    with open(CONFIG_FILE_NAME, 'r') as stream:
        document = yaml.load(stream)
        stream.close()
        cycle = document['clients'][0]['output']['parameters'][0]['parameters'
            ][0]['mapping'][quadri]
        option_map = document['clients'][0]['output']['parameters'][0][
            'parameters'][1]['mapping'][option]
        titre = document['clients'][0]['output']['parameters'][0]['parameters'
            ][5]['mapping'][name]
        if typ == 'exam' or typ == 'test':
            year = int(sys.argv[6])
            month = sys.argv[7]
            type_map = document['clients'][1]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code
                ) + ' - ' + titre + '/' + type_map + '/' + str(year
                ) + '_' + month.title()
        else:
            type_map = document['clients'][0]['output']['parameters'][1][
                'mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri
                ) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map
    print(out_path)


if __name__ == '__main__':
    main()

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul  9 17:48:56 2018

@author: Martin Braquet
"""

import os
import sys
import yaml

# Absolute path to the config file
CONFIG_FILE_NAME = '/home/martin/Documents/Syntheses/src/config.yml'    
            
def main():
    quadri = int(sys.argv[1])
    name = sys.argv[2]
    option = sys.argv[3]
    code = int(sys.argv[4])
    typ = sys.argv[5]
    with open(CONFIG_FILE_NAME, 'r') as stream:
        document = yaml.load(stream)
        stream.close()
        
        cycle = document['clients'][0]['output']['parameters'][0]['parameters'][0]['mapping'][quadri]
        option_map = document['clients'][0]['output']['parameters'][0]['parameters'][1]['mapping'][option]
        titre = document['clients'][0]['output']['parameters'][0]['parameters'][5]['mapping'][name]
        if typ == 'exam' or typ == 'test':
            year = int(sys.argv[6])
            month = sys.argv[7]
            type_map = document['clients'][1]['output']['parameters'][1]['mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map + '/' + str(year) + '_' + month.title()
        else:
            type_map = document['clients'][0]['output']['parameters'][1]['mapping'][typ]
            out_path = cycle + '/' + option_map + '/Q' + str(quadri) + '/L' + option + str(code) + ' - ' + titre + '/' + type_map
    
    print(out_path)
            
if __name__ == "__main__":
    main()