GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — SyncBoostNote/syncboostnote/config.py at master · DumbMachine/SyncBoostNote Expand file tree/ Copy pathconfig.pyMore file actions 71 lines (57 loc) · 1.71 KB / Copy pathconfig.pyFile metadata and controls71 lines (57 loc) · 1.71 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 import yaml import sys import os import readline import json home = os.path.expanduser("~") class git_commands: add = "git add -A" commit = "git commit -m {}" status = "git status" push = "git push origin master" Config = { "BOOSTNOTE_PATH": "~/BoostNotes", "SHIELDS": True, "SHIELDS_TYPE": "for-the-badge", "FREQUENCY": "hourly", "TIME": 1200 } def interactive(): conf = {} questions = [ ['BOOSTNOTE_PATH: ', ' ~/BoostNotes', 'BOOSTNOTE_PATH'], ['SHIELDS: ', ' True', 'SHIELDS'], ['SHIELDS_TYPE: ', 'for-the-badge', 'SHIELDS_TYPE'], ['FREQUENCY: ', 'hourly', 'FREQUENCY'], ['TIME: ', '1200', 'TIME'], # 24 gour format for now ] for question in questions: conf[question[2]] = input_with_prefill(question[0], question[1]) print(json.dumps( conf, indent=2 )) return conf def config_reader(location): config = yaml.load(open(location), Loader=yaml.Loader) print(json.dumps(config, indent=2)) return config def input_with_prefill(prompt, text): def hook(): readline.insert_text(text) readline.redisplay() readline.set_pre_input_hook(hook) result = input(prompt) readline.set_pre_input_hook() return result def generate_config(): ''' Creates a default config for users to see. ''' open( 'config.yaml', 'w+' ).write('''BOOSTNOTE_PATH: default # default: /home/$USER/Boostnote FREQUENCY: manual # ["hourly", "daily", "weekly", "onchange", "manual"] Others will be implemented soon. SHIELDS: true SHIELDS_TYPE: for-the-badge # ['plastic' , 'flat', 'flat-square', 'for-the-badge', 'popout', 'popout-square', 'social'] # TIME: 1200 Not recommended ''') |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |