elbowz / xbmc.service.pushbullet

Pushbullet Notification Client
GNU General Public License v3.0
22 stars 12 forks source link

Remove wild import from common and user full paths instead #17

Closed ruuk closed 9 years ago

ruuk commented 10 years ago

Would it be OK with you if we started doing this?

Reasons:

from lib.common import *

# Now logging is broken, and it's not obvious unless you know that log is in common
def log(msg):
    pass
from lib import common

common.log("This method is from common")

from lib.common import *
from example import *

log("Where did I get this method")
from lib.common import *
flyingMonkeys("My editor has no problem with flyingMonkeys, it assumes it was imported from lib.common")

from lib import common
flyingMonkeys("My editor warns me that flyingMonkeys is not defined")
elbowz commented 10 years ago

For me it's good!

Only for justify me, I have taken inspiration from official XBMC version check add-on: https://github.com/XBMC-Addons/service.xbmc.versioncheck/blob/master/service.py

p.s. thanks for the long explanation. It's really appreciated :)