diff --git a/SABnzbd.py b/SABnzbd.py index 63e6407..f997217 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -1521,8 +1521,8 @@ def main(): if sabnzbd.FOUNDATION: import sabnzbd.osxmenu sabnzbd.osxmenu.notify("SAB_Launched", None) - growler.send_notification('SABnzbd %s' % (sabnzbd.__version__), - "http://%s:%s/sabnzbd" % (browserhost, cherryport), 'startup') + growler.send_notification('SABnzbd%s' % growler.hostname(), + T('SABnzbd %s started') % sabnzbd.__version__, 'startup') # Now's the time to check for a new version check_latest_version() autorestarted = False diff --git a/sabnzbd/growler.py b/sabnzbd/growler.py index 45ae495..7ec1be9 100644 --- a/sabnzbd/growler.py +++ b/sabnzbd/growler.py @@ -137,10 +137,7 @@ def register_growl(): error = None host, port = sabnzbd.misc.split_host(sabnzbd.cfg.growl_server()) - if host: - sys_name = '@' + sabnzbd.misc.hostname().lower() - else: - sys_name = '' + sys_name = hostname(host) # Clean up persistent data in GNTP to make re-registration work GNTPRegister.notifications = [] @@ -304,3 +301,18 @@ def send_notification_center(title, msg, gtype): else: output = 'Notifier app not found' return output.strip('*\n ') + + +#------------------------------------------------------------------------------ +def hostname(host=True): + """ Return host's pretty name """ + if sabnzbd.WIN32: + sys_name = os.environ.get('computername', 'unknown') + try: + sys_name = os.uname()[1] + except: + sys_name = 'unknown' + if host: + return '@%s' % sys_name.lower() + else: + return '' diff --git a/sabnzbd/misc.py b/sabnzbd/misc.py index f9bc4cc..439dd30 100644 --- a/sabnzbd/misc.py +++ b/sabnzbd/misc.py @@ -717,17 +717,6 @@ def split_host(srv): #------------------------------------------------------------------------------ -def hostname(): - """ Return host's pretty name """ - if sabnzbd.WIN32: - return os.environ.get('computername', 'unknown') - try: - return os.uname()[1] - except: - return 'unknown' - - -#------------------------------------------------------------------------------ def check_mount(path): """ Return False if volume isn't mounted on Linux or OSX Retry 6 times with an interval of 1 sec.