metadata

Check-in [d4b4a6924b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Initial run
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:d4b4a6924b354b529da2caf6ceab05c336c5a8674e1312dca578bb0453637169
User & Date: vashon 2018-06-18 22:23:33
Context
2018-06-18
22:31
Handle network errors w. cleanup check-in: 5d912ee6bc user: vashon tags: trunk
22:23
Initial run check-in: d4b4a6924b user: vashon tags: trunk
22:05
Initial check-in check-in: 1888e3b612 user: vandys tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to main.py.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
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
# main.py
#	Provide metadata updates for one or more radio stations
#
# We pull the slowest stream we know, and scrape the Icecast
#  metadata from it, then hand that out to any requesting clients
#
import sys, time
from chore.handlers import Chore_Handler
from get import GET_mixin
from stream import Stream
import pdb

# Tie our various handlers together
class App_Handler(Chore_Handler, GET_mixin):
    def __init__(self, conn, tup, approot):
	Chore_Handler.__init__(self, conn, tup, approot,
	    (GET_mixin.__init__,))

# Load our configuration file
#
# This includes configuring our config file elements,
................................................................................
# Root of our app server
class App(chore.server.Server):

    def __init__(self, config):
	global DBlove

	# Let Chore handle most things
	chore.server.Server.__init__(self, config, App_Handler);

	# State per stream
	self.streams = {}

	# Set initial dict contents
	for sym,url in config["stream"]"
	    s = Stream(sym, url)
	    self.streams[sym] = s

if __name__ == "__main__":
    if len(sys.argv) != 2:
	sys.stderr.write("Usage is: %s <config-file>\n" %
	    (sys.argv[0],))
	sys.exit(1)

    # CLI if needed
    while True:
	time.sleep(60)







|





|







 







|





|












2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
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
# main.py
#	Provide metadata updates for one or more radio stations
#
# We pull the slowest stream we know, and scrape the Icecast
#  metadata from it, then hand that out to any requesting clients
#
import sys, time
import chore
from get import GET_mixin
from stream import Stream
import pdb

# Tie our various handlers together
class App_Handler(chore.handlers.Chore_Handler, GET_mixin):
    def __init__(self, conn, tup, approot):
	Chore_Handler.__init__(self, conn, tup, approot,
	    (GET_mixin.__init__,))

# Load our configuration file
#
# This includes configuring our config file elements,
................................................................................
# Root of our app server
class App(chore.server.Server):

    def __init__(self, config):
	global DBlove

	# Let Chore handle most things
	super().__init__(self, config, App_Handler);

	# State per stream
	self.streams = {}

	# Set initial dict contents
	for sym,url in config["stream"]:
	    s = Stream(sym, url)
	    self.streams[sym] = s

if __name__ == "__main__":
    if len(sys.argv) != 2:
	sys.stderr.write("Usage is: %s <config-file>\n" %
	    (sys.argv[0],))
	sys.exit(1)

    # CLI if needed
    while True:
	time.sleep(60)