From 2dfb816ddadb34e5b11676ef18c3c2f9079c8146 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 18 Sep 2018 19:01:36 +0200 Subject: throw away dead code --- titlebot/commands/up | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100755 titlebot/commands/up (limited to 'titlebot/commands/up') diff --git a/titlebot/commands/up b/titlebot/commands/up deleted file mode 100755 index 7aff594..0000000 --- a/titlebot/commands/up +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -import json -from os import environ -import sys -import os -# krebs polling -import poll - -f = 'suggestions.json' -db = poll.load_db(f) -votes = [] -votes = sys.argv[1:] -if not votes: - print("""usage: up number (...) - upvotes one or more entries based on .list""") - sys.exit(1) - -voter = environ['_prefix'].split("@")[1] -voter_name =environ['_from'] -for vote in votes: - try: - vote = int(vote) - if vote < 0: - raise Exception() - if voter in db[vote]['votes']: - print("%s, you already have voted for '%s'"%(voter_name,db[vote]['title']) ) - else: - db[vote]['votes'][voter] = 1 - print("%s voted for '%s'"%(voter_name,db[vote]['title'])) - except: - print("%s, voting for #%s failed" %(voter_name,vote)) - -poll.save_db(f,db) -- cgit v1.2.3