def launch_analytics(self, args): # Now that we're all done with the boot, send a beacone home launch_data = vars(args) launch_data['version'] = Version.current() launch_data['platform'] = platform.linux_distribution() try: launch_data['browser'] = subprocess.check_output(["xdg-settings", "get", "default-web-browser"]).strip() except subprocess.CalledProcessError as e: launch_data['browser'] = "unknown"
def main(): parser = argparse.ArgumentParser(description='Hacker News in your System Tray') parser.add_argument('-v','--version', action='version', version=Version.current()) parser.add_argument('-c','--comments', dest='comments',action='store_true', help="Load the HN comments link for the article as well") parser.add_argument('--chrome', dest='chrome', help="Specify a Google Chrome Profile directory to use for matching chrome history") parser.add_argument('--firefox', dest='firefox', help="Specify a Firefox Profile directory to use for matching firefox history") parser.add_argument('--dnt', dest='dnt',action='store_true', help="Disable all analytics (Do Not Track)") parser.set_defaults(comments=False) parser.set_defaults(dnt=False) args = parser.parse_args() indicator = HackerNewsApp(args) indicator.run()