Exemplo n.º 1
0
	def __init__(self):
		# @todo Use track object to manage current track, such as title
# 		self.track = track()
# 		self.track.test()
		self.track = '';
		self.vlc_player = vlcPlayer()
		connection_manager = connectionManager()
		self.client = connection_manager.client
Exemplo n.º 2
0
#!/usr/bin/python

from flask import Flask, request, render_template, url_for
import datetime
import os
from player import player
from connection_manager import connectionManager

app = Flask(__name__)

# Instantiate player object
player = player()

connection_manager = connectionManager()
client = connection_manager.client

@app.route("/", methods=['GET'])
def index():
	raw_data = open('data.txt')
	processed_data = []
	keys = ['title', 'user', 'permalink', 'duration', 'date', 'track_id']
	for line in raw_data:
		processed_data.append(dict(zip(keys, line.split(' | '))))
	tracks = processed_data
	try: # if there's a sort provided
		sort = request.args.get('sort')
		newlist = sorted(processed_data, key=lambda k: k[sort])
		tracks = newlist
	except KeyError:
		pass
Exemplo n.º 3
0
	def __init__(self):
		connection = connection_manager.connectionManager()
		self.client = connection.client