Navigation Menu

Skip to content

Commit

Permalink
efl: improve python imports
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure committed Feb 20, 2010
1 parent f2dadeb commit 71bc464
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 37 deletions.
4 changes: 2 additions & 2 deletions amsn2/ui/front_ends/efl/__init__.py
Expand Up @@ -8,12 +8,12 @@
# so the guimanager can access its classes
def load():
try:
import efl
import amsn2.ui.front_ends.efl.efl
except ImportError:
etype, value, trace = sys.exc_info()
traceback.print_exception(etype, value, trace.tb_next)
return None
return efl
return amsn2.ui.front_ends.efl.efl


# Initialize the front end by checking for any
Expand Down
9 changes: 3 additions & 6 deletions amsn2/ui/front_ends/efl/chat_window.py
@@ -1,12 +1,9 @@
from constants import *
from constants import CW_WIDTH, CW_HEIGHT
import evas
import ecore
import elementary
import skins
import window
from amsn2.ui import base
from amsn2.core.views import ContactView, StringView
from constants import *
from amsn2.core.views import StringView

class aMSNChatWindow(window.aMSNWindow, base.aMSNChatWindow):
def __init__(self, conversation_manager):
Expand Down Expand Up @@ -78,7 +75,7 @@ def __init__(self, amsn_conversation, parent, contacts_uid):
self.ine.size_hint_weight_set(evas.EVAS_HINT_EXPAND,
evas.EVAS_HINT_EXPAND)
self.ine.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
self.ine.event_callback_add(evas.EVAS_CALLBACK_KEY_DOWN, self.__ine_key_down);
self.ine.event_callback_add(evas.EVAS_CALLBACK_KEY_DOWN, self.__ine_key_down)
self.insc.content_set(self.ine)
self.ine.show()
self.insc.show()
Expand Down
7 changes: 1 addition & 6 deletions amsn2/ui/front_ends/efl/contact_list.py
@@ -1,17 +1,12 @@
# -*- coding: utf-8 -*-

from constants import *
from constants import THEME_FILE
import evas
import edje
import ecore
import ecore.evas
import elementary

from image import *

from amsn2.core.views import StringView
from amsn2.ui import base
import papyon

class aMSNContactListWindow(elementary.Box, base.aMSNContactListWindow):
def __init__(self, core, win):
Expand Down
4 changes: 0 additions & 4 deletions amsn2/ui/front_ends/efl/image.py
@@ -1,13 +1,9 @@

import evas
import ecore
import ecore.evas

import tempfile
import os

from amsn2.core.views import imageview

class Image(evas.SmartObject):
def __init__(self, skin, canvas, view):
self._evas = canvas
Expand Down
9 changes: 3 additions & 6 deletions amsn2/ui/front_ends/efl/login.py
@@ -1,12 +1,9 @@
from constants import *
from constants import THEME_FILE
import evas
import edje
import ecore
import ecore.x
import elementary

from amsn2.ui import base
from amsn2.core.views import accountview

#TODO: del?
class aMSNLoginWindow(elementary.Layout, base.aMSNLoginWindow):
Expand All @@ -30,7 +27,7 @@ def __init__(self, amsn_core, win):
sc = elementary.Scroller(self)
sc.content_min_limit(0, 1)
sc.policy_set(elementary.ELM_SCROLLER_POLICY_OFF,
elementary.ELM_SCROLLER_POLICY_OFF);
elementary.ELM_SCROLLER_POLICY_OFF)
sc.size_hint_weight_set(1.0, 0.0)
sc.size_hint_align_set(-1.0, -1.0)
self.content_set("login_screen.username", sc)
Expand All @@ -45,7 +42,7 @@ def __init__(self, amsn_core, win):
sc = elementary.Scroller(self)
sc.content_min_limit(0, 1)
sc.policy_set(elementary.ELM_SCROLLER_POLICY_OFF,
elementary.ELM_SCROLLER_POLICY_OFF);
elementary.ELM_SCROLLER_POLICY_OFF)
sc.size_hint_weight_set(1.0, 0.0)
sc.size_hint_align_set(-1.0, -1.0)
self.content_set("login_screen.password", sc)
Expand Down
8 changes: 1 addition & 7 deletions amsn2/ui/front_ends/efl/main.py
@@ -1,11 +1,5 @@
from constants import *
import ecore
import ecore.evas
import ecore.x
import skins
import window
from amsn2.ui import base
from amsn2.core.views import MenuView, MenuItemView

class aMSNMainWindow(window.aMSNWindow, base.aMSNMainWindow):
def __init__(self, amsn_core):
Expand All @@ -28,4 +22,4 @@ def __on_key_down(self, obj, event):
if event.keyname == "Escape":
self._amsn_core.quit()
else:
window.aMSNWindow._on_key_down(self,obj, event)
window.aMSNWindow._on_key_down(self, obj, event)
8 changes: 2 additions & 6 deletions amsn2/ui/front_ends/efl/window.py
@@ -1,14 +1,10 @@

from constants import *
from constants import WIDTH, HEIGHT, THEME_FILE, WM_NAME, WM_CLASS
import evas
import ecore
import ecore.evas
import ecore.x
import edje
import elementary

from amsn2.ui import base
from amsn2.core.views import MenuView, MenuItemView
from amsn2.core.views import MenuItemView

class aMSNWindow(elementary.Window, base.aMSNWindow):
def __init__(self, amsn_core):
Expand Down

0 comments on commit 71bc464

Please sign in to comment.