예제 #1
0
def icon_sorter(key):
    stack = brandiconsfinder.key_finder(key)['icons']
    icons = {'exclusive': stack[0], 'community': stack[1], 'fairsquare': stack[2], 'goodcolor': stack[3],
             'handmade': stack[4], 'indigenous': stack[5], 'recycled': stack[6], 'goodthread': stack[7]}

    output = (
        '\t' +  # good will
        icons['goodthread'] + '\t' +  # good thread
        '\t' +  # organic
        '\t' +  # pure
        icons['goodcolor'] + '\t' +  # good color
        '\t' +  # life cycle
        '\t' +  # energy conscious
        icons['community'] + '\t' +  # community/coop
        icons['fairsquare'] + '\t' +  # fair & square
        '\t' +  # cruelty free
        '\t' +  # local economy
        icons['handmade'] + '\t' +  # handmade
        '\t' +  # certified
        icons['indigenous'] + '\t' +  # indigenous
        icons['exclusive'] + '\t' +  # exclusive
        '\t' +  # ion count
        icons['recycled'] + '\t'  # recycled
    )
    return output.replace('1', 'yes').replace('0', '')
예제 #2
0
import iconsorter
import inputanalyzer
import outputanalyzer

user_input = input('Enter your data: ')

# user_input = '1421068_aura_china_wool_5-03x9-02_2700.jpg1421069_flatweave_india_wool_silk_5-03x9-02_2700.jpg'

input_list = []
data_stack = user_input.split('.jpg')
for i in range(0, len(data_stack)):
    input_list.append(inputanalyzer.input_analyzer(data_stack[i]))

for x in range(0, len(input_list) - 1):
    # Temporary strings to store values
    brand_icons = brandiconsfinder.key_finder(input_list[x])
    key = brand_icons['key']
    brand = brand_icons['brand']
    cat = brand_icons['cat']
    cm_cat = brand_icons['cm_cat']
    status = brand_icons['status']          # True if brand found, else False

    country_ethnic = countryfinder.country_finder(input_list[x])
    country = country_ethnic['country']
    ethnic = country_ethnic['ethnic']

    material_list = materialfinder.material_finder(input_list[x])
    mat_titles = material_list[0]
    mat_details = material_list[1]

    size_format = sizefinder.display_size(input_list[x])