|
14 | 14 | @pibooth.hookimpl |
15 | 15 | def pibooth_configure(cfg): |
16 | 16 | """Declare the new configuration options""" |
17 | | - cfg.add_option('QRCODE', 'qrcode_prefix', "https://github.com/pibooth/pibooth", |
| 17 | + cfg.add_option('QRCODE', 'prefix_url', "https://github.com/pibooth/pibooth", |
18 | 18 | "Prefix URL for the QR code") |
19 | 19 | cfg.add_option('QRCODE', 'unique_url', True, |
20 | 20 | "Use only one URL for all photos (one QR code linking to the album)", |
21 | 21 | "Use only one URL", ["True", "False"]) |
22 | | - cfg.add_option('QRCODE', 'code_foreground', (255, 255, 255), |
23 | | - "QR code foreground color", "QR code color", (255, 255, 255)) |
24 | | - cfg.add_option('QRCODE', 'code_background', (0, 0, 0), |
25 | | - "QR code background color", "QR background color", (0, 0, 0)) |
26 | | - |
| 22 | + cfg.add_option('QRCODE', 'foreground', (255, 255, 255), |
| 23 | + "QR code foreground color", "Color", (255, 255, 255)) |
| 24 | + cfg.add_option('QRCODE', 'background', (0, 0, 0), |
| 25 | + "QR code background color", "Background color", (0 ,0 ,0)) |
27 | 26 |
|
28 | 27 | @pibooth.hookimpl |
29 | 28 | def pibooth_startup(cfg, app): |
30 | 29 | """Store the qrcode prefix as an attribute of the app |
31 | 30 | """ |
32 | | - app.qrcode_prefix = cfg.get('QRCODE', 'qrcode_prefix') |
| 31 | + app.qrcode_prefix = cfg.get('QRCODE', 'prefix_url') |
33 | 32 |
|
34 | 33 |
|
35 | 34 | @pibooth.hookimpl |
@@ -60,9 +59,8 @@ def state_processing_exit(app, cfg): |
60 | 59 |
|
61 | 60 | qr.add_data(os.path.join(app.qrcode_prefix, name)) |
62 | 61 | qr.make(fit=True) |
63 | | - |
64 | | - qrcode_fill_color = '#%02x%02x%02x' % cfg.gettyped("QRCODE", 'code_foreground') |
65 | | - qrcode_background_color = '#%02x%02x%02x' % cfg.gettyped("QRCODE", 'code_background') |
| 62 | + qrcode_fill_color = '#%02x%02x%02x' %cfg.gettyped("QRCODE", 'foreground') |
| 63 | + qrcode_background_color = '#%02x%02x%02x' % cfg.gettyped("QRCODE", 'background') |
66 | 64 |
|
67 | 65 | image = qr.make_image(fill_color=qrcode_fill_color, back_color=qrcode_background_color) |
68 | 66 | app.previous_qr = pygame.image.fromstring(image.tobytes(), image.size, image.mode) |
|
0 commit comments