~brenthuisman/lastfmtagupdater

a5613623d18ebf6f8b6b1d133854beb63f06985d — Brent Huisman 4 years ago 6bb8725
Fixed imports
M lastfmtagupdater/__init__.py => lastfmtagupdater/__init__.py +4 -4
@@ 1,7 1,7 @@
import os.path,sys,common
from config import LastFM_Config
from medialibrary import MediaLibrary
from outputwrapper import OutputWrapper
import os.path,sys
from .config import LastFM_Config
from .medialibrary import MediaLibrary
from .outputwrapper import OutputWrapper

def main(argv=None):
    config = LastFM_Config(argv)

M lastfmtagupdater/config.py => lastfmtagupdater/config.py +2 -1
@@ 1,4 1,5 @@
import getopt,os.path,sys,configparser,common
import getopt,os.path,sys,configparser
from . import common

class LastFM_Config:
    config_section = 'lastfm_tagger'

M lastfmtagupdater/lastfmwrapper.py => lastfmtagupdater/lastfmwrapper.py +1 -1
@@ 1,4 1,4 @@
import sys,pylast,common,time
import sys,pylast,time

# Fetch tags from LastFM and convert them into a list of (tag, weight) pairs
class LastFM_Wrapper:

M lastfmtagupdater/mediahelper.py => lastfmtagupdater/mediahelper.py +2 -1
@@ 1,8 1,9 @@
import os,time,common,mutagen
import os,time,mutagen
from mutagen.flac import FLAC
from mutagen.id3 import ID3, TIT1, COMM, TCON, TPE1, TPE2, TIT2, TALB
from mutagen.mp4 import MP4
from mutagen.oggvorbis import OggVorbis
from . import common

class MediaHelper:
    config = None

M lastfmtagupdater/medialibrary.py => lastfmtagupdater/medialibrary.py +4 -3
@@ 1,7 1,8 @@
from lastfmwrapper import LastFM_Wrapper
from mediahelper import MediaHelper
import fileinput,os,string,time,sys
from xml.etree.ElementTree import Element, SubElement, ElementTree
import common,fileinput,os,string,time,sys
from . import common
from .lastfmwrapper import LastFM_Wrapper
from .mediahelper import MediaHelper

class MediaLibrary:
    # Media Library object:

M lastfmtagupdater/outputwrapper.py => lastfmtagupdater/outputwrapper.py +3 -3
@@ 1,5 1,5 @@
from config import LastFM_Config
import codecs,sys
from .config import LastFM_Config

'''
This helper class facilitates output to either the console or a GUI. If GUI mode is selected, the window will open


@@ 32,9 32,9 @@ class OutputWrapper():
        if (isinstance(msg, str)):
            pass#msg = msg.encode('latin1', 'replace')
        try:
            print(msg, file=consoleStream)
            print(msg)#, file=consoleStream)
        except:
            print(file=consoleStream)
            print(file)#=consoleStream)
            pass
        consoleStream.flush()