Commits

Gabriele Lanaro  committed 0247436

use of relative imports in pygtkhelpers to make the packaging stuff work

  • Participants
  • Parent commits 665ec8d
  • Branches packaging

Comments (0)

Files changed (14)

File filesnake/__main__.py

 
 from .gui.main_win import FileSnakeGUI
 
-fs = FileSnakeGUI()
+def main():
+    fs = FileSnakeGUI()
+    
+    # Need the spawning of two servers
+    serv = Server(IUIController(fs), 0)
+    port = serv.port
+    
+    def publish_service(sn):
+        try:
+            ServicePublisher(sn,"_filesnake._tcp", port)   
+        except:
+            publish_service(sn+"_")
+            
+    publish_service(socket.gethostname())
 
-# Need the spawning of two servers
-serv = Server(IUIController(fs), 0)
-port = serv.port
+    fs.show()
+    reactor.run()
 
-def publish_service(sn):
-    try:
-        ServicePublisher(sn,"_filesnake._tcp", port)   
-    except:
-        publish_service(sn+"_")
-
-publish_service(socket.gethostname())
-
-fs.show()
-reactor.run()
+if __name__ == '__main__':
+    main()

File filesnake/gui/main_win.py

-from pygtkhelpers.delegates import WindowView
-from pygtkhelpers.ui.dialogs import yesno
-from pygtkhelpers.ui import dialogs
+from ..pygtkhelpers.delegates import WindowView
+from ..pygtkhelpers.ui.dialogs import yesno
+from ..pygtkhelpers.ui import dialogs
 import gtk
 
 from .menu import UserMenu

File filesnake/gui/menu.py

-from pygtkhelpers.delegates import ToplevelView
+from ..pygtkhelpers.delegates import ToplevelView
 import gtk
 
 class UserMenu(ToplevelView):

File filesnake/gui/preferences.py

 '''
 Preferences dialog
 '''
-from pygtkhelpers.delegates import ToplevelView
+from ..pygtkhelpers.delegates import ToplevelView
 from ..settings import config, store_config, dest_dir
 
 class PreferencesDialog(ToplevelView):

File filesnake/gui/statusbar.py

 '''
 Statusbar, it's used as a "logger", it's a singleton used system-wide.
 '''
-from pygtkhelpers.delegates import SlaveView
+from ..pygtkhelpers.delegates import SlaveView
 import gtk
 
 statusbar = gtk.Statusbar()

File filesnake/gui/transfers.py

-from pygtkhelpers.ui.objectlist import ObjectList, Column, Cell
-from pygtkhelpers.delegates import SlaveView,ToplevelView
-from pygtkhelpers.utils import gsignal
+from ..pygtkhelpers.ui.objectlist import ObjectList, Column, Cell
+from ..pygtkhelpers.delegates import SlaveView,ToplevelView
+from ..pygtkhelpers.utils import gsignal
 from gobject import GObject
 import time
 

File filesnake/gui/userlist.py

-from pygtkhelpers.delegates import SlaveView
+from ..pygtkhelpers.delegates import SlaveView
 from collections import namedtuple
 import os
 

File filesnake/pygtkhelpers/addons.py

 
 """
 
-from pygtkhelpers.utils import GObjectUserDataProxy
+from ..utils import GObjectUserDataProxy
 
 
 def apply_addons(widget, *addon_types, **named_addon_types):

File filesnake/pygtkhelpers/forms.py

 
 from flatland import Dict, String, Integer, Boolean
 
-from pygtkhelpers.proxy import ProxyGroup, proxy_for
-from pygtkhelpers.delegates import SlaveView
-from pygtkhelpers.utils import gsignal
+from ..proxy import ProxyGroup, proxy_for
+from ..delegates import SlaveView
+from ..utils import gsignal
 
 
 def _view_type_for_element(element):

File filesnake/pygtkhelpers/proxy.py

 
 import gobject, gtk
 
-from pygtkhelpers.utils import gsignal
-from pygtkhelpers.ui.widgets import StringList, SimpleComboBox
+from .utils import gsignal
+from .ui.widgets import StringList, SimpleComboBox
 
 
 class GObjectProxy(gobject.GObject):

File filesnake/pygtkhelpers/ui/dialogs.py

     #XXX: util?
     obj.destroy()
     if not gtk.main_level():
-        from pygtkhelpers.utils import refresh_gui
+        from ..utils import refresh_gui
         refresh_gui()
 
 

File filesnake/pygtkhelpers/ui/objectlist.py

 
 import gtk, gobject
 
-from pygtkhelpers.utils import gsignal
+from ..utils import gsignal
 
 
 class PropertyMapper(object):

File filesnake/pygtkhelpers/ui/widgets.py

 
 import gtk
 
-from pygtkhelpers.utils import gsignal
+from ..utils import gsignal
 
 
 class StringList(gtk.VBox):
     def __init__(self, objectlist, attribute_list, default):
         gtk.HBox.__init__(self, spacing=3)
         self.set_border_width(3)
-        from pygtkhelpers.ui.widgets import SimpleComboBox
-        from pygtkhelpers.proxy import GtkComboBoxProxy
+        from ..ui.widgets import SimpleComboBox
+        from ..proxy import GtkComboBoxProxy
 
         self._objectlist = objectlist
 
       keywords = "lan file_transfer network utility",
       install_requires = "twisted",
       entry_points={
-        "gui_scripts": ["filesnake = filesnake.__main__"]
+        "gui_scripts": ["filesnake = filesnake.__main__:main"]
         }
      )