コード例 #1
0
ファイル: dcheck.py プロジェクト: ddierschow/bamca
# ------- infra --------------------------------------------------------

cmds = [
    ('c', count_tables, "count tables: [-v]"),
    ('sch', check_schema, "check schema"),
    ('tab', check_tables, "check tables: [table ...]"),
    ('dup', check_dups, "check duplicates"),
    ('bid', check_base_id, "check base_id"),
    ('add', check_attribute_pictures, "check attr_pics"),
    ('cas', check_castings, "check castings"),
    ('cat', show_categories, "show_categories"),
    ('vvscat', check_var_vs_categories, "check_var_vs_categories"),
    ('vscat', check_vs_categories, "check_vs_categories"),
    ('cat2mat', cat2matrix, "cat2matrix: cat"),
    ('cred', check_photo_credits, "check_photo_credits"),
    ('lnk', check_single_links, "check_single_links"),
    ('img', check_images, "check_images"),
    ('pic', check_pictures, "check_pictures"),
    ('prod', check_products, "check_products"),
    ('var', check_variations, "check_variations"),
]

# ------- --------------------------------------------------------------

if __name__ == '__main__':  # pragma: no cover
    basics.process_command_list(cmds=cmds,
                                dbedit='',
                                switches='vl',
                                options='s')
コード例 #2
0
            print(ln[1], pref + ln[0])


# ---- importers ------------------------------------------


importers = {
    'PSDC': import_psdc,
}


def import_links(pif):
    for assoc_id in assoc_ids:
        if assoc_id in importers:
            importers[assoc_id](pif)


# ---- commands -------------------------------------------


cmds = [
    ('i', import_links, "import"),
]


# ---- ----------------------------------------------------


if __name__ == '__main__':  # pragma: no cover
    basics.process_command_list(cmds=cmds, dbedit='')
コード例 #3
0
ファイル: busers.py プロジェクト: ddierschow/bamca
        entries[0]['value'] += ' ' + pif.render.fmt_art('bamca_member')
    footer = pif.render.format_hidden_input({'id': user['id']})
    footer += pif.render.format_button_input() + "</form>"
    footer += pif.render.format_button('change password', '/cgi-bin/chpass.cgi')
    if user['photographer_id']:
        footer += pif.render.format_button(
            'your pictures', '/cgi-bin/photogs.cgi?id={}'.format(user['photographer_id']))
    lsection = dict(columns=['title', 'value'], range=[{'entry': entries}], note='',
                    noheaders=True, header=header, footer=footer)
    return pif.render.format_template(
        'simplelistix.html',
        header=('''<br>Currently this information is only available to administrators of this website.  We're '''
                '''looking at possibly doing more in the future though.<br><br>'''),
        llineup=dict(section=[lsection]), nofooter=True)


# ------


def user_list(pif):
    print(pif.dbh.fetch_users())


cmds = [
    ('l', user_list, "list users"),
]


if __name__ == '__main__':  # pragma: no cover
    basics.process_command_list(cmds=cmds)