Bläddra i källkod

Full path for fortune command (d'Oh)

master
The Dod 4 år sedan
förälder
incheckning
982e9e8f6c
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2
    1
      fortunefeed.py

+ 2
- 1
fortunefeed.py Visa fil

@@ -4,6 +4,7 @@ from datetime import datetime, timedelta
4 4
 from min_rss_gen.generator import start_rss, gen_item
5 5
 import xml.etree.ElementTree
6 6
 
7
+FORTUNE_CMD = '/usr/games/fortune'
7 8
 FEED_LINK = 'https://linux.die.net/man/6/fortune'
8 9
 FEED_TITLE = 'Fortune'
9 10
 FEED_DESCRIPTION = 'Random, hopefully interesting, adages'
@@ -13,7 +14,7 @@ MAX_LENGTH = 69
13 14
 rss_items = []
14 15
 
15 16
 for i in range(NUM_ITEMS):
16
-    with Popen(['fortune', '-s', '-n', str(MAX_LENGTH)], encoding='utf-8', stdout=PIPE) as fortune:
17
+    with Popen([FORTUNE_CMD, '-s', '-n', str(MAX_LENGTH)], encoding='utf-8', stdout=PIPE) as fortune:
17 18
         rss_items.append(gen_item(
18 19
             title=fortune.stdout.read().strip().replace('\n',' ').replace('\t',' '),
19 20
             link=FEED_LINK,

Laddar…
Avbryt
Spara