Esempio n. 1
0
 def send_folder(self, dirpath = None):
     from hub import Hub
     if dirpath is None:
         dirpath = Hub.getInstance().get_dir('Choose a directory to send '
                                             'to %s.' % self.name)
     if dirpath:
         finfo = fileinfo(dirpath)
         if len(finfo.files) == 0:
             Hub.getInstance().on_error(ValueError('No files in that directory.'))
         elif finfo.size == 0:
             Hub.getInstance().on_error(ValueError('There are zero bytes in that directory.'))
         else:
             self.protocol.send_file(self, finfo)
Esempio n. 2
0
    def send_file(self, filepath = None):
        if filepath is None:
            from hub import Hub
            filepath = Hub.getInstance().get_file('Sending file to %s' % self.name)

        if filepath:
            finfo = fileinfo(filepath)
            if finfo.size:
                if self.online:
                    xfer = self.protocol.send_file(self, finfo)
                    profile.xfers.insert(0, xfer)
            else:
                from hub import Hub
                Hub.getInstance().on_error(FileTransferException('%s is an empty file' % finfo.name))
Esempio n. 3
0
 def send_folder(self, dirpath=None):
     from hub import Hub
     if dirpath is None:
         dirpath = Hub.getInstance().get_dir('Choose a directory to send '
                                             'to %s.' % self.name)
     if dirpath:
         finfo = fileinfo(dirpath)
         if len(finfo.files) == 0:
             Hub.getInstance().on_error(
                 ValueError('No files in that directory.'))
         elif finfo.size == 0:
             Hub.getInstance().on_error(
                 ValueError('There are zero bytes in that directory.'))
         else:
             self.protocol.send_file(self, finfo)
Esempio n. 4
0
    def send_file(self, filepath = None):
        if filepath is None:
            from hub import Hub
            filepath = Hub.getInstance().get_file('Sending file to %s' % self.name)

        if filepath:
            self.protocol.send_file(self, fileinfo(filepath))
Esempio n. 5
0
    def send_file(self, filepath=None):
        if filepath is None:
            from hub import Hub
            filepath = Hub.getInstance().get_file('Sending file to %s' %
                                                  self.name)

        if filepath:
            finfo = fileinfo(filepath)
            if finfo.size:
                if self.online:
                    xfer = self.protocol.send_file(self, finfo)
                    profile.xfers.insert(0, xfer)
            else:
                from hub import Hub
                Hub.getInstance().on_error(
                    FileTransferException('%s is an empty file' % finfo.name))
Esempio n. 6
0
from util.primitives.error_handling import traceguard, try_this
from util.primitives.funcs import do
from util.primitives.mapping import Storage

import gui

from gui.uberwidgets.panelframe import PanelFrame
from gui.buddylist.accountlist import AccountList
from gui.uberwidgets.connectionlist import ConnectionsPanel
from gui.buddylist.accounttray import AccountTrayIcon
from gui.native import memory_event
from common import profile, bind
from gui.toolbox import AddInOrder, calllimit

from hub import Hub
hub = Hub.getInstance()
from gui.toolbox import saveWindowPos
from gui.toolbox import Monitor
from gui.statuscombo import StatusCombo
from common import pref
from cgui import SimplePanel

# keys which are ignored for starting searches.
_function_keys = [getattr(wx, 'WXK_F' + str(i)) for i in xrange(1, 13)]

platform_disallowed_keys = []
if config.platform == 'win':
    platform_disallowed_keys.extend(
        [wx.WXK_WINDOWS_LEFT, wx.WXK_WINDOWS_RIGHT])

disallowed_search_keys = frozenset(
Esempio n. 7
0
import functools
import uuid

import util
import util.callbacks as callbacks
import util.xml_tag as xml_tag
import util.cacheable as cacheable
import lxml.etree as ET
import lxml.builder as B
from util.Events import event
from util.primitives.error_handling import try_this
from util.primitives.funcs import get, isint
from util.primitives.mapping import Storage


from hub import Hub; hub = Hub.getInstance()
import ZSI

import msn
from msn.p12 import Notification as Super
from msn import Message
#from msn.SOAP import MSNABSharingService as MSNAB
MSNAB = Null

from mail.passport import escape, unescape

from msn.p10.MSNP10Notification import GroupId, ContactId

from ZSI import FaultException

defcb = dict(trid=True, callback=sentinel)
Esempio n. 8
0
from util.primitives.funcs import do
from util.primitives.mapping import Storage

import gui

from gui.uberwidgets.panelframe import PanelFrame
from gui.buddylist.accountlist import AccountList
from gui.uberwidgets.connectionlist import ConnectionsPanel
from gui.buddylist.accounttray import AccountTrayIcon
from gui.native import memory_event
from common import profile, bind
from gui.toolbox import AddInOrder, calllimit


from hub import Hub
hub = Hub.getInstance()
from gui.toolbox import saveWindowPos
from gui.toolbox import Monitor
from gui.statuscombo import StatusCombo
from common import pref
from cgui import SimplePanel

# keys which are ignored for starting searches.
_function_keys = [getattr(wx, 'WXK_F' + str(i)) for i in xrange(1, 13)]

platform_disallowed_keys = []
if config.platform == 'win':
    platform_disallowed_keys.extend([wx.WXK_WINDOWS_LEFT, wx.WXK_WINDOWS_RIGHT])

disallowed_search_keys = frozenset([wx.WXK_ESCAPE, wx.WXK_MENU, wx.WXK_TAB,
    wx.WXK_BACK] + platform_disallowed_keys + _function_keys)