Beispiel #1
0
from terra.core.controller import Controller
from terra.core.manager import Manager
from terra.core.terra_object import TerraObject
from terra.core.threaded_func import ThreadedFunction
from terra.ui.modal import Modal
from terra.ui.throbber import ElmThrobber
from terra.ui.panel import PanelContentFrame
from terra.ui.base import PluginEdjeWidget
from terra.ui.base import PluginThemeMixin
from manager import PicasaManager
from utils import parse_timestamp

manager = Manager()
picasa_manager = PicasaManager()

ModalController = manager.get_class("Controller/Modal")
PanelContentModal = manager.get_class("Widget/Settings/PanelContentModal")
UsernamePasswordModal = \
                    manager.get_class("Widget/Settings/UsernamePasswordModal")
MixedListController = manager.get_class("Controller/Settings/Folder/MixedList")
ModalThrobber = manager.get_class("Widget/Settings/ModalThrobber")

log = logging.getLogger("plugins.canola-picasa.options")

###########################################################
#Settings
###########################################################

class OptionsController(MixedListController):
    terra_type = "Controller/Settings/Folder/InternetMedia/Picasa"
Beispiel #2
0
# User Software Agreement, the licensors of this Program grant you additional
# permission to convey the resulting work.

import ecore
import logging

from terra.core.manager import Manager
from terra.core.threaded_func import ThreadedFunction

from manager import LastfmManager
from client import HandshakeError, AuthenticationError

manager = Manager()
lastfm_manager = LastfmManager()
network = manager.get_status_notifier("Network")
ModalController = manager.get_class("Controller/Modal")
UsernamePasswordModal = manager.get_class("Widget/Settings/UsernamePasswordModal")
MixedListController = manager.get_class("Controller/Settings/Folder/MixedList")

log = logging.getLogger("plugins.canola-lastfm.options")


class OptionsController(MixedListController):
    terra_type = "Controller/Settings/Folder/InternetMedia/Lastfm"


class UserPassController(ModalController):
    terra_type = "Controller/Settings/Folder/InternetMedia/Lastfm/UserPass"

    def __init__(self, model, canvas, parent):
        ModalController.__init__(self, model, canvas, parent)
Beispiel #3
0
from manager import PicasaManager, GpsManager

from terra.core.task import Task
from terra.core.manager import Manager
from terra.core.model import Model, ModelFolder
from terra.core.threaded_func import ThreadedFunction
from terra.core.plugin_prefs import PluginPrefs


manager = Manager()
db = manager.canola_db
picasa_manager = PicasaManager()
gps_manager = GpsManager()

PluginDefaultIcon = manager.get_class("Icon/Plugin")
OptionsActionModel = manager.get_class("Model/Options/Action")
OptionsModelFolder = manager.get_class("Model/Options/Folder")

CanolaError = manager.get_class("Model/Notify/Error")
EntryDialogModel = manager.get_class("Model/EntryDialog")

log = logging.getLogger("plugins.canola-picasa.model")


class Icon(PluginDefaultIcon):
    terra_type = "Icon/Folder/Task/Image/Picasa"
    icon = "icon/main_item/picasa"
    plugin = "picasa"

Beispiel #4
0
import os.path

from math import cos, pi

import ecore

from terra.core.manager import Manager
from terra.ui.grid import CellRenderer
from terra.ui.base import EdjeWidget
from terra.ui.base import Widget
from terra.ui.screen import Screen
from terra.ui.kinetic import KineticMouse
from terra.core.terra_object import TerraObject

mger = Manager()
DownloadManager = mger.get_class("DownloadManager")
download_mger = DownloadManager()

log = logging.getLogger("canola.plugins.images.utils")


def download_file(model, path, url, callback_exists=None, \
      callback_downloaded=None, callback_in_progress=None, attr="downloader"):

    def download_again(url, path, model):
        log.error("Download again")
        downloader = download_mger.add(url, path)
        downloader.on_finished_add(download_finished)
        downloader.start(True)
        model.__setattr__(attr, downloader)
Beispiel #5
0
import os
import edje
import logging

from terra.core.task import Task
from terra.core.manager import Manager
from terra.core.model import Model, ModelFolder
from terra.core.plugin_prefs import PluginPrefs

manager = Manager()
PluginDefaultIcon = manager.get_class("Icon/Plugin")
Photos  = manager.get_class("Model/Folder/Image/All")

Button  = manager.get_class("Model/Settings/Action")
log = logging.getLogger("plugins.canola-twitpic.model")

class Icon(PluginDefaultIcon):
    terra_type = "Icon/Folder"
    icon = "icon/main_item/photos_local"
    plugin = "canola-twitpic"


class LocalPictures(Photos):
    terra_type = "Model/Folder/Image/Twitpic"

    def __init__(self,name, parent):
        Photos.__init__(self,name, parent)	

class MainModelFolder(ModelFolder, Task):
    terra_type = "Model/Folder/Task/Image/Twitpic"
    terra_task_type = "Task/Folder/Task/Image/Twitpic"
Beispiel #6
0
#!/usr/bin/env python

import evas
import ecore
import locale
import logging

from terra.core.manager import Manager
from terra.core.controller import Controller
from terra.ui.base import PluginThemeMixin

from model import SendModelFolder,ViewFriendsModelFolder,ViewPublicModelFolder,ViewRepliesModelFolder

manager = Manager()

BaseListController = manager.get_class("Controller/Folder")
EntryDialogModel = manager.get_class("Model/EntryDialog")
BaseRowRenderer =  manager.get_class("Widget/RowRenderer")
OptionsControllerMixin = manager.get_class("OptionsControllerMixin")

log = logging.getLogger("plugins.twitter.ui")

class ListController(BaseListController):
    """This is used to initialize the twitter navigation list."""
    
    terra_type = "Controller/Folder/Task/Apps/Twitter"
    
    def __init__(self, model, canvas, parent):
        BaseListController.__init__(self, model, canvas, parent)
        self.model.callback_notify = self._show_notify
        
Beispiel #7
0
import logging

from terra.core.task import Task
from terra.core.manager import Manager
from terra.core.model import ModelFolder
from terra.utils.encoding import to_utf8
from terra.core.threaded_func import ThreadedFunction

from client import TuningError
from manager import JamendoManager
from utils import get_cover_path, normalize_path

mger = Manager()
jam_manager = JamendoManager()
network = mger.get_status_notifier("Network")
PluginDefaultIcon = mger.get_class("Icon/Plugin")
CanolaError = mger.get_class("Model/Notify/Error")
ActionModelFolder = mger.get_class("Model/Options/Action")
OptionsModelFolder = mger.get_class("Model/Options/Folder")
BaseAudioLocalModel = mger.get_class("Model/Media/Audio/Local")

log = logging.getLogger("plugins.canola-jamendo.model")

TAG_LAST_PLAYED = "last_played_songs"

(SERVICE_PERSONAL, SERVICE_SIMILAR_ARTISTS,
SERVICE_TAG, SERVICE_RADIO) = range(4)


class Icon(PluginDefaultIcon):
    terra_type = "Icon/Folder/Task/Audio/Jamendo"
Beispiel #8
0
import logging
import ecore
from terra.core.manager import Manager
from terra.core.threaded_func import ThreadedFunction
from terra.ui.base import PluginThemeMixin

from twit import *

manager = Manager()
ThumbController = manager.get_class("Controller/Folder/Image")
EntryDialogModel = manager.get_class("Model/EntryDialog")
NotifyModel = manager.get_class("Model/Notify")
WaitNotifyModel = manager.get_class("Model/WaitNotify")

log = logging.getLogger("plugins.canola-twitpic.controller")

class TwitController(ThumbController):
	terra_type = "Controller/Folder/Image/Twitpic"
	def __init__(self, model, canvas, parent):
		ThumbController.__init__(self,model, canvas,parent)
	
	def _cb_on_clicked(self, image_frame):

		def th_function(upload):
			upload.upload()

		def th_finished(exception, retval):
			self.waitDialog.stop()
			code, msg = self.upload.getResponse()
			dialog = NotifyModel("Upload to Twitpic", msg , answer_callback=None)
			self.parent.show_notify(dialog)
Beispiel #9
0
import os
import urllib
import logging

from terra.core.manager import Manager
from terra.core.task import Task
from terra.core.model import ModelFolder, Model
from terra.core.threaded_func import ThreadedFunction

from manager import TwitterManager
from client import AuthError, TwitterError

import utils

manager = Manager()
OptionsModelFolder = manager.get_class("Model/Options/Folder")
CanolaError = manager.get_class("Model/Notify/Error")
network = manager.get_status_notifier("Network")
twitter_manager = TwitterManager()

PluginDefaultIcon = manager.get_class("Icon/Plugin")

log = logging.getLogger("plugins.canola-tube.twitter.model")

class Icon(PluginDefaultIcon):
    terra_type = "Icon/Folder/Task/Apps/Twitter"
    icon = "icon/main_item/twitter"
    plugin = "twitter"
    
class MainModelFolder(ModelFolder, Task):
    """Main model.
Beispiel #10
0
# with Canola2 and its core components (or a modified version of any of those),
# containing parts covered by the terms of Instituto Nokia de Tecnologia End
# User Software Agreement, the licensors of this Program grant you additional
# permission to convey the resulting work.

import logging

from terra.core.manager import Manager
from terra.ui.base import PluginThemeMixin

from model import AudioLocalModel, PromptModelFolder, HistoryModelFolder, \
    HistoryOptionsModel


manager = Manager()
CanolaError = manager.get_class("Model/Notify/Error")
YesNoDialogModel = manager.get_class("Model/YesNoDialog")
EntryDialogModel = manager.get_class("Model/EntryDialog")
BaseListController = manager.get_class("Controller/Folder")
BaseAudioPlayerController = manager.get_class("Controller/Media/Audio")
OptionsControllerMixin = manager.get_class("OptionsControllerMixin")

log = logging.getLogger("plugins.canola-jamendo.ui")


class ListController(BaseListController, OptionsControllerMixin):
    """Last.fm Navigation List.

    This is the basic list of Last.fm plugin. It shows all
    navigation possibilities. It extends the base Canola
    list to show a search dialog in some cases.
import ecore
import logging
from time import mktime, localtime
from datetime import datetime

from Queue import Queue
from terra.core.manager import Manager
from terra.core.plugin_prefs import PluginPrefs
from terra.core.threaded_func import ThreadedFunction

from manager import LastfmManager


mger = Manager()
lastfm_manager = LastfmManager()
PlayerHook = mger.get_class("Hook/Player")
network = mger.get_status_notifier("Network")

log = logging.getLogger("plugins.canola-lastfm.scrobbler")


class AudioScrobbler(PlayerHook):
    terra_type = "Hook/Player/Audio"
    time_cons = 240
    np_time = 5
    max_cached = 200

    def __init__(self):
        PlayerHook.__init__(self)
        self._model = None
        self._timer = None
Beispiel #12
0
from efl_utils.animations import DecelerateTimelineAnimation as \
                                                    TimelineAnimation

from terra.core.manager import Manager
from terra.ui.grid import CellRenderer
from terra.ui.base import EdjeWidget
from terra.ui.base import Widget
from terra.ui.base import PluginThemeMixin
from terra.ui.screen import Screen
from terra.core.terra_object import TerraObject
from terra.ui.kinetic import KineticMouse

from utils import *

mger = Manager()
DownloadManager = mger.get_class("DownloadManager")
download_mger = DownloadManager()

log = logging.getLogger("canola.plugins.images.ui")
KineticGridWidget = mger.get_class("Widget/KineticGrid")

def calc_max_expand_size(w, h, max_w, max_h):
    if h == 0:
        log.error("Trying to expand image with size 0")
        return 0, 0

    aspect = float(w) / float(h)

    if w > max_w:
        w = max_w
        h = w / aspect