Clean setup file, create launch script

- Setup file: 'entry_point' is used in stead of non-existent
  'bin/hackertray' for scripts
- hackertray package init file
  - does not check if it is called as a script (which should not happen)
  - main() code is now replaced in HackerNewsApp.run()
  - main() instantiates the app and calls run() on it (previous roles
    grouped)
This commit is contained in:
Bruno Cauet 2013-11-28 15:02:12 +01:00
parent 3614d1f597
commit 73aa49812e
2 changed files with 9 additions and 7 deletions

View File

@ -65,6 +65,10 @@ class HackerNewsApp:
file.write(json.dumps(l))
gtk.main_quit()
def run(self):
gtk.main()
return 0
'''Opens the link in the web browser'''
def open(self, widget, event=None, data=None):
#We disconnect and reconnect the event in case we have
@ -107,9 +111,5 @@ def getHomePage():
return r.json()
def main():
gtk.main()
return 0
if __name__ == "__main__":
indicator = HackerNewsApp()
main()
indicator.run()

View File

@ -11,5 +11,7 @@ setup(name='hackertray',
install_requires=[
'requests',
],
scripts=['bin/hackertray'],
zip_safe=False)
entry_points={
'console_scripts': ['hackertray = hackertray:main'],
},
zip_safe=False)