From c3baf3c081378f1731366e566dac68578e13b36d Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sun, 29 Dec 2019 17:59:42 +0100 Subject: [PATCH 01/16] fix line (test magit) --- deefuzzer/recorder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/deefuzzer/recorder.py b/deefuzzer/recorder.py index 4ddb312..93d4bf6 100644 --- a/deefuzzer/recorder.py +++ b/deefuzzer/recorder.py @@ -36,6 +36,7 @@ # Author: Guillaume Pellerin + import os From 7f3054ba77a813d1b357011e9d25f94880ae6a94 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 30 Dec 2019 02:48:35 +0100 Subject: [PATCH 02/16] Add Python 3 compatibility, fix various encoding options, need DEBUG --- deefuzzer/__init__.py | 6 ++-- deefuzzer/core.py | 26 ++++++++------ deefuzzer/player.py | 8 ++--- deefuzzer/relay.py | 8 ++--- deefuzzer/station.py | 31 ++++++++-------- deefuzzer/tools/PyRSS2Gen.py | 12 +++---- deefuzzer/tools/__init__.py | 20 +++++------ deefuzzer/tools/get_access_token.py | 56 ++++++++++++++--------------- deefuzzer/tools/mediabase.py | 4 +-- deefuzzer/tools/mp3.py | 4 +-- deefuzzer/tools/ogg.py | 6 ++-- deefuzzer/tools/osc.py | 4 +-- deefuzzer/tools/utils.py | 14 ++------ deefuzzer/tools/webm.py | 2 +- deefuzzer/tools/xmltodict2.py | 26 +++++++------- scripts/deefuzzer | 2 +- scripts/osc/osc_jingles_start.py | 4 +-- scripts/osc/osc_jingles_stop.py | 4 +-- scripts/osc/osc_player_fast.py | 4 +-- scripts/osc/osc_player_next.py | 2 +- scripts/osc/osc_player_slow.py | 4 +-- scripts/osc/osc_record_start.py | 4 +-- scripts/osc/osc_record_stop.py | 4 +-- scripts/osc/osc_relay_start.py | 4 +-- scripts/osc/osc_relay_stop.py | 4 +-- scripts/osc/osc_twitter_start.py | 4 +-- scripts/osc/osc_twitter_stop.py | 4 +-- 27 files changed, 134 insertions(+), 137 deletions(-) diff --git a/deefuzzer/__init__.py b/deefuzzer/__init__.py index c15a1c9..f1545c9 100644 --- a/deefuzzer/__init__.py +++ b/deefuzzer/__init__.py @@ -1,5 +1,5 @@ -from core import * -from station import * -from tools import * +from .core import * +from .station import * +from .tools import * __version__ = '0.7.3' diff --git a/deefuzzer/core.py b/deefuzzer/core.py index a43617e..a57ed67 100644 --- a/deefuzzer/core.py +++ b/deefuzzer/core.py @@ -36,12 +36,14 @@ # Author: Guillaume Pellerin + import os import shout -import Queue +import queue import datetime import mimetypes import hashlib +import platform from threading import Thread from deefuzzer.station import * from deefuzzer.tools import * @@ -58,7 +60,7 @@ class DeeFuzzer(Thread): station_settings = [] station_instances = {} watch_folder = {} - log_queue = Queue.Queue() + log_queue = queue.Queue() main_loop = False ignore_errors = False max_retry = 0 @@ -67,9 +69,11 @@ def __init__(self, conf_file): Thread.__init__(self) self.conf_file = conf_file self.conf = get_conf_dict(self.conf_file) - - if 'deefuzzer' not in self.conf: - return + + print(self.conf) + + if 'deefuzzer' not in self.conf : + raise('This is not a standard deefuzzer config file') # Get the log setting first (if possible) log_file = str(self.conf['deefuzzer'].pop('log', '')) @@ -78,9 +82,8 @@ def __init__(self, conf_file): os.makedirs(self.log_dir) self.logger = QueueLogger(log_file, self.log_queue) self.logger.start() - #print(self.conf) - for key in self.conf['deefuzzer'].keys(): + for key in list(self.conf['deefuzzer'].keys()): if key == 'm3u': self.m3u = str(self.conf['deefuzzer'][key]) @@ -113,6 +116,7 @@ def __init__(self, conf_file): # Set the deefuzzer logger self._info('Starting DeeFuzzer') + self._info('Using Python version %s' % platform.python_version()) self._info('Using libshout version %s' % shout.version()) self._info('Number of stations : ' + str(len(self.station_settings))) @@ -202,7 +206,7 @@ def create_station(self, folder, options): return self._info('Creating station for folder ' + folder) d = dict(path=folder, name=name) - for i in options.keys(): + for i in list(options.keys()): if 'folder' not in i: s[i] = replace_all(options[i], d) if 'media' not in s: @@ -259,7 +263,7 @@ def add_station(self, this_station): return def run(self): - q = Queue.Queue(1) + q = queue.Queue(1) ns = 0 p = Producer(q) p.start() @@ -317,12 +321,12 @@ def run(self): if 'short_name' in self.station_settings[i]['infos']: name = self.station_settings[i]['infos']['short_name'] y = 1 - while name in self.station_instances.keys(): + while name in list(self.station_instances.keys()): y += 1 name = self.station_settings[i]['infos']['short_name'] + " " + str(y) self.station_settings[i]['station_name'] = name - namehash = hashlib.md5(name).hexdigest() + namehash = hashlib.md5(str(name).encode('utf-8')).hexdigest() self.station_settings[i]['station_statusfile'] = os.sep.join([self.log_dir, namehash]) new_station = Station(self.station_settings[i], q, self.log_queue, self.m3u) diff --git a/deefuzzer/player.py b/deefuzzer/player.py index ac7fe06..3945b85 100644 --- a/deefuzzer/player.py +++ b/deefuzzer/player.py @@ -36,7 +36,7 @@ # Author: Guillaume Pellerin -from relay import * +from .relay import * import time @@ -80,7 +80,7 @@ def file_read_fast(self): def file_read_slow(self): """Read a bigger part of the media and stream the little parts of the data through a generator""" - m = open(self.media, 'r') + m = open(self.media, 'rb') while True: self.main_chunk = m.read(self.main_buffer_size) if not self.main_chunk: @@ -122,7 +122,7 @@ class URLReader: def __init__(self, relay): self.__relayparam = relay - self.relay = urllib.urlopen(self.__relayparam) + self.relay = urllib.request.urlopen(self.__relayparam) self.rec_mode = 0 def set_recorder(self, recorder, mode=1): @@ -137,7 +137,7 @@ def read_callback(self, size): except: while True: try: - self.relay = urllib.urlopen(self.__relayparam) + self.relay = urllib.request.urlopen(self.__relayparam) chunk = self.relay.read(size) break except: diff --git a/deefuzzer/relay.py b/deefuzzer/relay.py index b3d7c9a..2a91b0c 100644 --- a/deefuzzer/relay.py +++ b/deefuzzer/relay.py @@ -37,8 +37,8 @@ # Author: Guillaume Pellerin from threading import Thread -import Queue -import urllib +import queue +import urllib.request, urllib.parse, urllib.error class Relay(Thread): @@ -47,7 +47,7 @@ def __init__(self, sub_buffer_size, queue_size): Thread.__init__(self) self.sub_buffer_size = sub_buffer_size self.queue_size = queue_size - self.queue = Queue.Queue(self.queue_size) + self.queue = queue.Queue(self.queue_size) self.stream = None def set_url(self, url): @@ -55,7 +55,7 @@ def set_url(self, url): def open(self): try: - self.stream = urllib.urlopen(self.url) + self.stream = urllib.request.urlopen(self.url) self.isopen = True except: self.isopen = False diff --git a/deefuzzer/station.py b/deefuzzer/station.py index d31838d..614973c 100644 --- a/deefuzzer/station.py +++ b/deefuzzer/station.py @@ -43,18 +43,18 @@ import string import random import shout -import urllib +import urllib.request, urllib.parse, urllib.error import mimetypes import json import hashlib import MySQLdb as mdb from threading import Thread -from player import * -from recorder import * -from relay import * -from streamer import * -from tools import * +from .player import * +from .recorder import * +from .relay import * +from .streamer import * +from .tools import * class Station(Thread): @@ -456,7 +456,7 @@ def get_playlist(self): for row in rows: file_list.append(row[0]) - except mdb.Error, e: + except mdb.Error as e: self._err('Could not get playlist from MySQLdb, Error %d: %s' % (e.args[0], e.args[1])) finally: @@ -501,7 +501,7 @@ def get_playlist(self): return file_list def get_array_hash(self, s): - return hashlib.md5(str(s)).hexdigest() + return hashlib.md5(str(s).encode('utf-8')).hexdigest() def get_jingles(self): file_list = [] @@ -614,7 +614,7 @@ def media_to_objs(self, media_list): file_meta = Ogg(media) elif file_ext.lower() == 'webm' or mimetypes.guess_type(media)[0] == 'video/webm': file_meta = WebM(media) - except Exception, e: + except Exception as e: self._err('Could not get specific media type class for %s' % (media)) self._err('Error: %s' % (str(e))) pass @@ -648,7 +648,7 @@ def update_feeds(self, media_list, rss_file, sub_title): media_description = '' media_description_item = '' - for key in media.metadata.keys(): + for key in list(media.metadata.keys()): if media.metadata[key] != '': if key == 'filepath' and not self.feeds_showfilepath: continue @@ -749,7 +749,8 @@ def get_songmeta(self, mediaobj): song = mediaobj.get_song(True) except: pass - + + print(title, artist, song) return title, artist, song def get_currentsongmeta(self): @@ -832,7 +833,7 @@ def ping_server(self): while not self.server_ping: try: - server = urllib.urlopen(self.server_url) + server = urllib.request.urlopen(self.server_url) self.server_ping = True self._info('Channel available.') except: @@ -856,7 +857,7 @@ def icecastloop_nextmedia(self): self.set_read_mode() return True - except Exception, e: + except Exception as e: self._err('icecastloop_nextmedia: Error: ' + str(e)) return False @@ -879,9 +880,9 @@ def icecastloop_metadata(self): try: self.update_twitter_current() if self.song: - self.channel.set_metadata({'song': self.song, 'charset': 'utf-8'}) + self.channel.set_metadata({'song': str(self.song), 'charset': 'utf-8'}) return True - except Exception, e: + except Exception as e: self._err('icecastloop_metadata: Error: ' + str(e)) return False diff --git a/deefuzzer/tools/PyRSS2Gen.py b/deefuzzer/tools/PyRSS2Gen.py index 56b249a..17c090b 100644 --- a/deefuzzer/tools/PyRSS2Gen.py +++ b/deefuzzer/tools/PyRSS2Gen.py @@ -24,10 +24,10 @@ def write_xml(self, outfile, encoding="iso-8859-1"): def to_xml(self, encoding="iso-8859-1"): try: - import cStringIO as StringIO + import io as StringIO except ImportError: - import StringIO - f = StringIO.StringIO() + import io + f = io.StringIO() self.write_xml(f, encoding) return f.getvalue() @@ -35,7 +35,7 @@ def to_xml(self, encoding="iso-8859-1"): def _element(handler, name, obj, d=None): if not d: d = {} - if isinstance(obj, basestring) or obj is None: + if isinstance(obj, str) or obj is None: # special-case handling to make the API easier # to use for the common case. handler.startElement(name, d) @@ -377,7 +377,7 @@ def publish(self, handler): _opt_element(handler, "lastBuildDate", lastBuildDate) for category in self.categories: - if isinstance(category, basestring): + if isinstance(category, str): category = Category(category) category.publish(handler) @@ -459,7 +459,7 @@ def publish(self, handler): _opt_element(handler, "author", self.author) for category in self.categories: - if isinstance(category, basestring): + if isinstance(category, str): category = Category(category) category.publish(handler) diff --git a/deefuzzer/tools/__init__.py b/deefuzzer/tools/__init__.py index 276c198..0ccf127 100644 --- a/deefuzzer/tools/__init__.py +++ b/deefuzzer/tools/__init__.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -from xmltodict import * -from PyRSS2Gen import * -from mediabase import * -from mp3 import * -from ogg import * -from webm import * -from logger import * -from osc import * -from twitt import * -from utils import * +from .xmltodict import * +from .PyRSS2Gen import * +from .mediabase import * +from .mp3 import * +from .ogg import * +from .webm import * +from .logger import * +from .osc import * +from .twitt import * +from .utils import * diff --git a/deefuzzer/tools/get_access_token.py b/deefuzzer/tools/get_access_token.py index 6801019..0158a22 100644 --- a/deefuzzer/tools/get_access_token.py +++ b/deefuzzer/tools/get_access_token.py @@ -19,7 +19,7 @@ # parse_qsl moved to urlparse module in v2.6 try: - from urlparse import parse_qsl + from urllib.parse import parse_qsl except: from cgi import parse_qsl @@ -34,56 +34,56 @@ consumer_secret = '1kNEffHgGSXO2gMNTr8HRum5s2ofx3VQnJyfd0es' if consumer_key is None or consumer_secret is None: - print 'You need to edit this script and provide values for the' - print 'consumer_key and also consumer_secret.' - print '' - print 'The values you need come from Twitter - you need to register' - print 'as a developer your "application". This is needed only until' - print 'Twitter finishes the idea they have of a way to allow open-source' - print 'based libraries to have a token that can be used to generate a' - print 'one-time use key that will allow the library to make the request' - print 'on your behalf.' - print '' + print('You need to edit this script and provide values for the') + print('consumer_key and also consumer_secret.') + print('') + print('The values you need come from Twitter - you need to register') + print('as a developer your "application". This is needed only until') + print('Twitter finishes the idea they have of a way to allow open-source') + print('based libraries to have a token that can be used to generate a') + print('one-time use key that will allow the library to make the request') + print('on your behalf.') + print('') sys.exit(1) signature_method_hmac_sha1 = oauth.SignatureMethod_HMAC_SHA1() oauth_consumer = oauth.Consumer(key=consumer_key, secret=consumer_secret) oauth_client = oauth.Client(oauth_consumer) -print 'Requesting temp token from Twitter' +print('Requesting temp token from Twitter') resp, content = oauth_client.request(REQUEST_TOKEN_URL, 'GET') if resp['status'] != '200': - print 'Invalid respond from Twitter requesting temp token: %s' % resp['status'] + print('Invalid respond from Twitter requesting temp token: %s' % resp['status']) else: request_token = dict(parse_qsl(content)) - print '' - print 'Please visit this Twitter page and retrieve the pincode to be used' - print 'in the next step to obtaining an Authentication Token:' - print '' - print '%s?oauth_token=%s' % (AUTHORIZATION_URL, request_token['oauth_token']) - print '' + print('') + print('Please visit this Twitter page and retrieve the pincode to be used') + print('in the next step to obtaining an Authentication Token:') + print('') + print('%s?oauth_token=%s' % (AUTHORIZATION_URL, request_token['oauth_token'])) + print('') - pincode = raw_input('Pincode? ') + pincode = input('Pincode? ') token = oauth.Token(request_token['oauth_token'], request_token['oauth_token_secret']) token.set_verifier(pincode) - print '' - print 'Generating and signing request for an access token' - print '' + print('') + print('Generating and signing request for an access token') + print('') oauth_client = oauth.Client(oauth_consumer, token) resp, content = oauth_client.request(ACCESS_TOKEN_URL, method='POST', body='oauth_verifier=%s' % pincode) access_token = dict(parse_qsl(content)) if resp['status'] != '200': - print 'The request for a Token did not succeed: %s' % resp['status'] - print access_token + print('The request for a Token did not succeed: %s' % resp['status']) + print(access_token) else: - print 'Your Twitter Access Token key: %s' % access_token['oauth_token'] - print ' Access Token secret: %s' % access_token['oauth_token_secret'] - print '' + print('Your Twitter Access Token key: %s' % access_token['oauth_token']) + print(' Access Token secret: %s' % access_token['oauth_token_secret']) + print('') diff --git a/deefuzzer/tools/mediabase.py b/deefuzzer/tools/mediabase.py index ee74697..9fca41f 100644 --- a/deefuzzer/tools/mediabase.py +++ b/deefuzzer/tools/mediabase.py @@ -80,7 +80,7 @@ def get_file_metadata(self, clear_cache=False): def read_file_metadata(self): """Reads the metadata for the media, filtered by the tagdata dictionary for this media type""" self.metadata = {} - for key in self.tagdata.keys(): + for key in list(self.tagdata.keys()): self.metadata[key] = '' try: self.metadata[key] = self.sourceobj[key][0] @@ -107,7 +107,7 @@ def get_metadata_value(self, key, clean=False, clear_cache=False): r = ""; if clean: r = r.replace('_',' ').strip() - return r.encode('utf-8') + return r def get_title(self): """Returns the cleaned title for this media""" diff --git a/deefuzzer/tools/mp3.py b/deefuzzer/tools/mp3.py index bc14cd6..47ea9ce 100644 --- a/deefuzzer/tools/mp3.py +++ b/deefuzzer/tools/mp3.py @@ -42,7 +42,7 @@ from mutagen.easyid3 import EasyID3 from mutagen.mp3 import MP3, MPEGInfo from mutagen import id3 -from utils import * +from .utils import * EasyID3.valid_keys["comment"] = "COMM::'XXX'" EasyID3.valid_keys["copyright"] = "TCOP::'XXX'" @@ -95,7 +95,7 @@ def write_tags(self): respect of mutagen classes and methods""" self.sourceobj.add_tags() - self.sourceobj.tags['TIT2'] = id3.TIT2(encoding=2, text=u'text') + self.sourceobj.tags['TIT2'] = id3.TIT2(encoding=2, text='text') self.sourceobj.save() ''' diff --git a/deefuzzer/tools/ogg.py b/deefuzzer/tools/ogg.py index 8f9adea..e0dc15f 100644 --- a/deefuzzer/tools/ogg.py +++ b/deefuzzer/tools/ogg.py @@ -40,7 +40,7 @@ import string import datetime from mutagen.oggvorbis import OggVorbis -from utils import * +from .utils import * class Ogg(MediaBase): @@ -102,7 +102,7 @@ def decode(self): def write_tags(self): # self.ogg.add_tags() - for tag in self.metadata.keys(): + for tag in list(self.metadata.keys()): self.sourceobj[tag] = str(self.metadata[tag]) self.sourceobj.save() @@ -122,7 +122,7 @@ def get_args(self, options=None): else: args.append('-Q -b ' + self.bitrate_default) - for tag in self.metadata.keys(): + for tag in list(self.metadata.keys()): value = clean_word(self.metadata[tag]) args.append('-c %s="%s"' % (tag, value)) if tag in self.tagdata: diff --git a/deefuzzer/tools/osc.py b/deefuzzer/tools/osc.py index b4bb72a..41cc1bc 100644 --- a/deefuzzer/tools/osc.py +++ b/deefuzzer/tools/osc.py @@ -47,8 +47,8 @@ def __init__(self, port): self.port = port try: self.server = liblo.Server(self.port) - except liblo.ServerError, err: - print str(err) + except liblo.ServerError as err: + print(str(err)) def add_method(self, path, type, method): self.server.add_method(path, type, method) diff --git a/deefuzzer/tools/utils.py b/deefuzzer/tools/utils.py index fb70538..3a1b783 100644 --- a/deefuzzer/tools/utils.py +++ b/deefuzzer/tools/utils.py @@ -71,12 +71,12 @@ def replace_all(option, repl): return r elif isinstance(option, dict): r = {} - for key in option.keys(): + for key in list(option.keys()): r[key] = replace_all(option[key], repl) return r elif isinstance(option, str): r = option - for key in repl.keys(): + for key in list(repl.keys()): r = r.replace('[' + key + ']', repl[key]) return r return option @@ -94,16 +94,8 @@ def get_conf_dict(file): elif 'yaml' in mime_type or 'yml' in mime_type: import yaml - - def custom_str_constructor(loader, node): - return loader.construct_scalar(node).encode('utf-8') - - yaml.add_constructor(u'tag:yaml.org,2002:str', custom_str_constructor) confile = open(file, 'r') - data = confile.read() - confile.close() - for c in yaml.load_all(data): - conf = c + conf = yaml.safe_load(confile) return conf elif 'json' in mime_type: diff --git a/deefuzzer/tools/webm.py b/deefuzzer/tools/webm.py index f39eff0..85ab2d6 100644 --- a/deefuzzer/tools/webm.py +++ b/deefuzzer/tools/webm.py @@ -39,7 +39,7 @@ import os import string import datetime -from utils import * +from .utils import * class WebM(MediaBase): diff --git a/deefuzzer/tools/xmltodict2.py b/deefuzzer/tools/xmltodict2.py index bf0ea46..2a59523 100644 --- a/deefuzzer/tools/xmltodict2.py +++ b/deefuzzer/tools/xmltodict2.py @@ -173,7 +173,7 @@ def xmltodict(xml, attsToSkip=None, addCodeFile=False): # argument was a file try: ret = parser.ParseFromFile(xml) - except expat.ExpatError, e: + except expat.ExpatError as e: errmsg = _("The XML in '%s' is not well-formed and cannot be parsed: %s") % (xml, e) else: # argument must have been raw xml: @@ -186,7 +186,7 @@ def xmltodict(xml, attsToSkip=None, addCodeFile=False): except expat.ExpatError: errmsg = _("An invalid XML string was encountered") if errmsg: - raise dabo.dException.XmlException, errmsg + raise dabo.dException.XmlException(errmsg) if addCodeFile and isPath: # Get the associated code file, if any codePth = "%s-code.py" % os.path.splitext(xml)[0] @@ -194,8 +194,8 @@ def xmltodict(xml, attsToSkip=None, addCodeFile=False): try: codeDict = desUtil.parseCodeFile(open(codePth).read()) desUtil.addCodeToClassDict(ret, codeDict) - except StandardError, e: - print "Failed to parse code file:", e + except Exception as e: + print("Failed to parse code file:", e) return ret @@ -203,10 +203,10 @@ def escQuote(val, noEscape=False, noQuote=False): """Add surrounding quotes to the string, and escape any illegal XML characters. """ - if not isinstance(val, basestring): + if not isinstance(val, str): val = str(val) - if not isinstance(val, unicode): - val = unicode(val, default_encoding) + if not isinstance(val, str): + val = str(val, default_encoding) if noQuote: qt = '' else: @@ -246,7 +246,7 @@ def dicttoxml(dct, level=0, header=None, linesep=None): ret = "" if "attributes" in dct: - for key, val in dct["attributes"].items(): + for key, val in list(dct["attributes"].items()): # Some keys are already handled. noEscape = key in ("sizerInfo",) val = escQuote(val, noEscape) @@ -262,10 +262,10 @@ def dicttoxml(dct, level=0, header=None, linesep=None): ret += "%s" % dct["cdata"].replace("<", "<") if "code" in dct: - if len(dct["code"].keys()): + if len(list(dct["code"].keys())): ret += "%s%s%s" % (eol, "\t" * (level + 1), eol) methodTab = "\t" * (level + 2) - for mthd, cd in dct["code"].items(): + for mthd, cd in list(dct["code"].items()): # Convert \n's in the code to eol: cd = eol.join(cd.splitlines()) @@ -281,12 +281,12 @@ def dicttoxml(dct, level=0, header=None, linesep=None): ret += "%s%s" % ("\t" * (level + 1), eol) if "properties" in dct: - if len(dct["properties"].keys()): + if len(list(dct["properties"].keys())): ret += "%s%s%s" % (eol, "\t" * (level + 1), eol) currTab = "\t" * (level + 2) - for prop, val in dct["properties"].items(): + for prop, val in list(dct["properties"].items()): ret += "%s<%s>%s" % (currTab, prop, eol) - for propItm, itmVal in val.items(): + for propItm, itmVal in list(val.items()): itmTab = "\t" * (level + 3) ret += "%s<%s>%s%s" % (itmTab, propItm, itmVal, propItm, eol) ret += "%s%s" % (currTab, prop, eol) diff --git a/scripts/deefuzzer b/scripts/deefuzzer index 3c9c6ef..e728514 100755 --- a/scripts/deefuzzer +++ b/scripts/deefuzzer @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import sys diff --git a/scripts/osc/osc_jingles_start.py b/scripts/osc/osc_jingles_start.py index 6e5177c..b15c8d6 100644 --- a/scripts/osc/osc_jingles_start.py +++ b/scripts/osc/osc_jingles_start.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_jingles_stop.py b/scripts/osc/osc_jingles_stop.py index 84e3044..7e2f4f5 100644 --- a/scripts/osc/osc_jingles_stop.py +++ b/scripts/osc/osc_jingles_stop.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_player_fast.py b/scripts/osc/osc_player_fast.py index fedf9db..0262c5f 100644 --- a/scripts/osc/osc_player_fast.py +++ b/scripts/osc/osc_player_fast.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_player_next.py b/scripts/osc/osc_player_next.py index ef0e30f..8de7678 100644 --- a/scripts/osc/osc_player_next.py +++ b/scripts/osc/osc_player_next.py @@ -7,7 +7,7 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: +except liblo.AddressError as err: sys.exit(err) # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_player_slow.py b/scripts/osc/osc_player_slow.py index a5761bd..1dff54f 100644 --- a/scripts/osc/osc_player_slow.py +++ b/scripts/osc/osc_player_slow.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_record_start.py b/scripts/osc/osc_record_start.py index d0b5fe5..4472367 100644 --- a/scripts/osc/osc_record_start.py +++ b/scripts/osc/osc_record_start.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_record_stop.py b/scripts/osc/osc_record_stop.py index 0bfa651..25bd3dc 100644 --- a/scripts/osc/osc_record_stop.py +++ b/scripts/osc/osc_record_stop.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_relay_start.py b/scripts/osc/osc_relay_start.py index 19c06a1..0e1919e 100644 --- a/scripts/osc/osc_relay_start.py +++ b/scripts/osc/osc_relay_start.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_relay_stop.py b/scripts/osc/osc_relay_stop.py index d54af34..83584b2 100644 --- a/scripts/osc/osc_relay_stop.py +++ b/scripts/osc/osc_relay_stop.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_twitter_start.py b/scripts/osc/osc_twitter_start.py index b10d0cc..6e39d2e 100644 --- a/scripts/osc/osc_twitter_start.py +++ b/scripts/osc/osc_twitter_start.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments diff --git a/scripts/osc/osc_twitter_stop.py b/scripts/osc/osc_twitter_stop.py index 1a33947..9f5eda1 100644 --- a/scripts/osc/osc_twitter_stop.py +++ b/scripts/osc/osc_twitter_stop.py @@ -7,8 +7,8 @@ # send all messages to port 1234 on the local machine try: target = liblo.Address(1234) -except liblo.AddressError, err: - print str(err) +except liblo.AddressError as err: + print(str(err)) sys.exit() # send message "/foo/message1" with int, float and string arguments From bb497282696f24bc44cdcaf724cc243468fbbb59 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 30 Dec 2019 02:57:56 +0100 Subject: [PATCH 03/16] [setup] force py3 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 9dca157..5953b3d 100644 --- a/setup.py +++ b/setup.py @@ -38,4 +38,5 @@ packages=find_packages(), include_package_data=True, zip_safe=False, + python_requires='>=3', ) From 3a7a3ff734dc8476d4d013e592b9b4cf3f262acf Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 30 Dec 2019 03:01:10 +0100 Subject: [PATCH 04/16] [setup] set classifiers to py3 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5953b3d..55e0214 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,8 @@ from setuptools import setup, find_packages CLASSIFIERS = [ - 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Sound/Audio :: Players', From c787a7a309ffb55dfac122df949b625350733dc3 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 30 Dec 2019 03:38:31 +0100 Subject: [PATCH 05/16] [travis] use py3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2ac2879..b747229 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python python: - - "2.7" + - "3.7" virtualenv: system_site_packages: true From 1c52a5b0b4e2cee6973b344bf3ff6129d1dc2979 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 30 Dec 2019 03:45:33 +0100 Subject: [PATCH 06/16] [travis] use py3.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b747229..4a110f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python python: - - "3.7" + - "3.6" virtualenv: system_site_packages: true From c491791e711ab78177828d8a33f1f57dc60c0984 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 30 Dec 2019 03:49:21 +0100 Subject: [PATCH 07/16] [travis] add matrix --- .travis.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a110f4..714e171 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,18 @@ language: python -python: - - "3.6" + +matrix: + include: + - python: 3.7 + os: linux + compiler: gcc + virtualenv: system_site_packages: true # command to prepare the system to install prerequisites or dependencies before_install: - sudo apt-get install -qq python-setuptools - - sudo apt-get install -qq python-pip python-dev libshout3-dev python-liblo python-mutagen python-pycurl liblo-dev libshout3-dev librtmp-dev python-yaml libcurl4-openssl-dev python-mutagen + - sudo apt-get install -qq python-pip python-dev libshout3-dev python-liblo python-mutagen python-pycurl liblo-dev libshout3-dev librtmp-dev python-yaml libcurl4-openssl-dev python-mutagen libmariadbclient-dev # command to run tests script: From 9ed038416cc0f6985dbe9fe7d7f945b5ab2d3cf9 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 10:48:38 +0100 Subject: [PATCH 08/16] goto 0.8.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 55e0214..5c063f8 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ long_description=open('README.rst').read(), author="Guillaume Pellerin", author_email="yomguy@parisson.com", - version='0.7.3', + version='0.8.0', install_requires=[ 'setuptools', 'python-shout==0.2.6', From 5942e87af7b93a1df7172773849b0f8ce017686b Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 10:57:46 +0100 Subject: [PATCH 09/16] cleanup prints --- deefuzzer/core.py | 2 +- deefuzzer/station.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deefuzzer/core.py b/deefuzzer/core.py index a57ed67..4e6c0cd 100644 --- a/deefuzzer/core.py +++ b/deefuzzer/core.py @@ -70,7 +70,7 @@ def __init__(self, conf_file): self.conf_file = conf_file self.conf = get_conf_dict(self.conf_file) - print(self.conf) + # print(self.conf) if 'deefuzzer' not in self.conf : raise('This is not a standard deefuzzer config file') diff --git a/deefuzzer/station.py b/deefuzzer/station.py index 614973c..35e851a 100644 --- a/deefuzzer/station.py +++ b/deefuzzer/station.py @@ -750,7 +750,7 @@ def get_songmeta(self, mediaobj): except: pass - print(title, artist, song) + # print(title, artist, song) return title, artist, song def get_currentsongmeta(self): From 1bcbfe66961b21bd6339b67f16cdfabae6b6fadc Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 11:05:19 +0100 Subject: [PATCH 10/16] [licence] update headers against GPL --- deefuzzer/core.py | 45 +++++++++++++------------------------ deefuzzer/player.py | 45 +++++++++++++------------------------ deefuzzer/recorder.py | 45 +++++++++++++------------------------ deefuzzer/relay.py | 37 +++++++++--------------------- deefuzzer/station.py | 45 +++++++++++++------------------------ deefuzzer/streamer.py | 45 +++++++++++++------------------------ deefuzzer/tools/osc.py | 45 +++++++++++++------------------------ deefuzzer/tools/streamer.py | 45 +++++++++++++------------------------ deefuzzer/tools/twitt.py | 45 +++++++++++++------------------------ scripts/dev/xml2yaml.py | 45 +++++++++++++------------------------ 10 files changed, 146 insertions(+), 296 deletions(-) diff --git a/deefuzzer/core.py b/deefuzzer/core.py index 4e6c0cd..2b87a88 100644 --- a/deefuzzer/core.py +++ b/deefuzzer/core.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + import os diff --git a/deefuzzer/player.py b/deefuzzer/player.py index 3945b85..adbed42 100644 --- a/deefuzzer/player.py +++ b/deefuzzer/player.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from .relay import * import time diff --git a/deefuzzer/recorder.py b/deefuzzer/recorder.py index 93d4bf6..187e06c 100644 --- a/deefuzzer/recorder.py +++ b/deefuzzer/recorder.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + import os diff --git a/deefuzzer/relay.py b/deefuzzer/relay.py index 2a91b0c..ab96384 100644 --- a/deefuzzer/relay.py +++ b/deefuzzer/relay.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. +# This file is part of deefuzzer -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin from threading import Thread import queue diff --git a/deefuzzer/station.py b/deefuzzer/station.py index 35e851a..37ce72f 100644 --- a/deefuzzer/station.py +++ b/deefuzzer/station.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + import os import sys diff --git a/deefuzzer/streamer.py b/deefuzzer/streamer.py index 54fb5ca..6977735 100644 --- a/deefuzzer/streamer.py +++ b/deefuzzer/streamer.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from threading import Thread diff --git a/deefuzzer/tools/osc.py b/deefuzzer/tools/osc.py index 41cc1bc..29a627e 100644 --- a/deefuzzer/tools/osc.py +++ b/deefuzzer/tools/osc.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from threading import Thread diff --git a/deefuzzer/tools/streamer.py b/deefuzzer/tools/streamer.py index bc95923..4267502 100644 --- a/deefuzzer/tools/streamer.py +++ b/deefuzzer/tools/streamer.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from threading import Thread diff --git a/deefuzzer/tools/twitt.py b/deefuzzer/tools/twitt.py index d487dd1..7475061 100644 --- a/deefuzzer/tools/twitt.py +++ b/deefuzzer/tools/twitt.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # Twitter DeeFuzzer keys DEEFUZZER_CONSUMER_KEY = 'ozs9cPS2ci6eYQzzMSTb4g' diff --git a/scripts/dev/xml2yaml.py b/scripts/dev/xml2yaml.py index bcc0174..0f60341 100755 --- a/scripts/dev/xml2yaml.py +++ b/scripts/dev/xml2yaml.py @@ -5,36 +5,21 @@ # -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin +# This file is part of deefuzzer + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + import sys From 7877368afb02f76ef83ed8b6aded8aade72326f5 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 12:12:39 +0100 Subject: [PATCH 11/16] [conf] fix XML parsing using xmltodict from pypi --- deefuzzer/tools/utils.py | 3 ++- setup.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/deefuzzer/tools/utils.py b/deefuzzer/tools/utils.py index 3a1b783..7b74f07 100644 --- a/deefuzzer/tools/utils.py +++ b/deefuzzer/tools/utils.py @@ -16,6 +16,7 @@ import mimetypes from itertools import chain from deefuzzer.tools import * +import xmltodict mimetypes.add_type('application/x-yaml', '.yaml') @@ -90,7 +91,7 @@ def get_conf_dict(file): confile = open(file, 'r') data = confile.read() confile.close() - return xmltodict(data, 'utf-8') + return xmltodict.parse(data) elif 'yaml' in mime_type or 'yml' in mime_type: import yaml diff --git a/setup.py b/setup.py index 5c063f8..6f2f772 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ 'pycurl', 'pyyaml', 'mysqlclient', + 'xmltodict', ], platforms=['OS Independent'], license='GPL v3', From 91b5cc388383e58f24451162c111e556fbe40403 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 12:23:16 +0100 Subject: [PATCH 12/16] [setup] pin deps --- setup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 6f2f772..d9d18a6 100644 --- a/setup.py +++ b/setup.py @@ -25,13 +25,13 @@ install_requires=[ 'setuptools', 'python-shout==0.2.6', - 'python-twitter', - 'mutagen', - 'pyliblo', - 'pycurl', - 'pyyaml', - 'mysqlclient', - 'xmltodict', + 'python-twitter==3.5', + 'mutagen==1.43.0', + 'pyliblo==0.10.0', + 'pycurl==7.43.0.2', + 'pyyaml==3.13', + 'mysqlclient==1.4.6', + 'xmltodict==0.12.0', ], platforms=['OS Independent'], license='GPL v3', From 6c10b6d3c4a6ea1a3f9caf36dc1882c3ffed48af Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 12:31:46 +0100 Subject: [PATCH 13/16] [setup] use requirements, bump to 0.8.0a --- requirements.txt | 10 +++++++++- setup.py | 10 +--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requirements.txt b/requirements.txt index 897fb90..4e6fc20 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,10 @@ setuptools --e . \ No newline at end of file +python-shout==0.2.6 +python-twitter==3.5 +mutagen==1.43.0 +pyliblo==0.10.0 +pycurl==7.43.0.2 +pyyaml==3.13 +mysqlclient==1.4.6 +xmltodict==0.12.0 +-e . diff --git a/setup.py b/setup.py index d9d18a6..00db1cf 100644 --- a/setup.py +++ b/setup.py @@ -21,17 +21,9 @@ long_description=open('README.rst').read(), author="Guillaume Pellerin", author_email="yomguy@parisson.com", - version='0.8.0', + version='0.8.0a', install_requires=[ 'setuptools', - 'python-shout==0.2.6', - 'python-twitter==3.5', - 'mutagen==1.43.0', - 'pyliblo==0.10.0', - 'pycurl==7.43.0.2', - 'pyyaml==3.13', - 'mysqlclient==1.4.6', - 'xmltodict==0.12.0', ], platforms=['OS Independent'], license='GPL v3', From 5b19d025e03eeaa115c2119fb8ce32903869fc4e Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 12:50:01 +0100 Subject: [PATCH 14/16] [setup] add cython3, add wheel, fix py3 packages --- README.rst | 2 +- setup.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 080566a..ccde926 100644 --- a/README.rst +++ b/README.rst @@ -98,7 +98,7 @@ an install inside Gygwin should work well. To install it, say on Debian, do:: - sudo apt-get install python-pip python-dev python-liblo \ + sudo apt-get install python3-pip python3-dev cython3 python-liblo \ python-mutagen python-pycurl python-yaml \ libshout3-dev librtmp-dev liblo-dev \ libcurl4-openssl-dev libmariadbclient-dev diff --git a/setup.py b/setup.py index 00db1cf..a8c1de1 100644 --- a/setup.py +++ b/setup.py @@ -21,9 +21,18 @@ long_description=open('README.rst').read(), author="Guillaume Pellerin", author_email="yomguy@parisson.com", - version='0.8.0a', + version='0.8.0a1', install_requires=[ 'setuptools', + 'wheel', + 'python-shout==0.2.6', + 'python-twitter==3.5', + 'mutagen==1.43.0', + 'pyliblo==0.10.0', + 'pycurl==7.43.0.2', + 'pyyaml==3.13', + 'mysqlclient==1.4.6', + 'xmltodict==0.12.0', ], platforms=['OS Independent'], license='GPL v3', From 01a779555df6dfe942985c223a500c3be28c1229 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 12:52:17 +0100 Subject: [PATCH 15/16] [setup] fix version --- deefuzzer/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deefuzzer/__init__.py b/deefuzzer/__init__.py index f1545c9..f82e626 100644 --- a/deefuzzer/__init__.py +++ b/deefuzzer/__init__.py @@ -2,4 +2,4 @@ from .station import * from .tools import * -__version__ = '0.7.3' +__version__ = '0.8.0' diff --git a/setup.py b/setup.py index a8c1de1..a534992 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ long_description=open('README.rst').read(), author="Guillaume Pellerin", author_email="yomguy@parisson.com", - version='0.8.0a1', + version='0.8.0a2', install_requires=[ 'setuptools', 'wheel', From 011e3806ba4a0ec3a052d57919770c2c37f3dc66 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 Dec 2019 18:46:13 +0100 Subject: [PATCH 16/16] [setup] bump to 0.8.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a534992..a77a123 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ long_description=open('README.rst').read(), author="Guillaume Pellerin", author_email="yomguy@parisson.com", - version='0.8.0a2', + version='0.8.0', install_requires=[ 'setuptools', 'wheel',
%s: %s