Commit graph libervia-backend/src/core/exceptions.py
Author SHA1 Message Date
Goffi
503f8644ba core: replaced SkipHistory exception by a key in mess_data:
SkipHistory was skipping all remaining triggers just to skip history, which is not the intented behaviour.
    Now history can be skipped by setting mess_data[u'history'] = C.HISTORY_SKIP, this way we won't skip importants triggers.
    When history is skipped, mess_data[u'extra'][u'history'] will be set to C.HISTORY_SKIP for frontends, so they can inform user that the message is not stored locally.
2017-02-05 14:55:21 +01:00
Goffi
04515e5013 plugin XEP-0045, quick_frontend + primitivus (chat): cleaning of XEP-0045 (first pass):
- bridge methods/signals now all start with "muc" to follow new convention
    - internal method use client instead of profile to follow new convention
    - removed excetpions from plugin XEP-0045 in favor of core.exceptions, NotReady added
    - cleaned/simplified several part of the code. checkClient removed as it is not needed anymore
    - self.clients map removed, muc data are now stored directly in client
    - getRoomEntityNick and getRoomNicksOfUsers are removed as they don't look sane.
        /!\ This break all room game plugins for the moment
    - use of uuid4 instead of uuid1 for getUniqueName, as host ID and current time are used for uuid1
2016-06-27 21:45:11 +02:00
Goffi
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
Goffi
c43362ab3f plugin blog import dotclear: this plugin import Dotclear 2 backups 2016-01-22 20:24:17 +01:00
Goffi
ad973c6a2c core: fixed launchAction:
- getClient now raise a NotFound error if client is not available
    - errors ConnectedProfileError, NotConnectedProfileError anf ProfileKeyUnknownError renamed for consistency (all profile error must prefixed by Profile)
    - launchAction fixed, the case where client is not available is handled
    - kept actions are actuall1y removed on launchAction
2015-11-18 11:06:24 +01:00
Goffi
f61c88f784 plugin XEP-0065: session cleaning and timeout + log choosed candidate when using SI File Transfer 2015-11-13 16:46:32 +01:00
Goffi
2e70b01b28 core: more robust plugins loading:
- avoid stopping loading remaining plugins when a plugin raise an error
    - new error exceptions.MissingModule allows to detect a missing third party module, and to give instructions to get it
    - error during instanciation are catched too
2015-09-29 17:54:23 +02:00
Goffi
8ce5c1862b core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
/!\ not finished, everything is still instable !
    - bridge: DBus bridge has been modified to allow blocking call to be called in the same way as asynchronous calls
    - bridge: calls with a callback and no errback are now possible, default errback log the error
    - constants: removed hack to manage presence without OrderedDict, as an OrderedDict like class has been implemented in Libervia
    - core: getLastResource has been removed and replaced by getMainResource (there is a global better management of resources)
    - various style improvments: use of constants when possible, fixed variable overlaps, import of module instead of direct class import
    - frontends: printInfo and printMessage methods in (Quick)Chat are more generic (use of extra instead of timestamp)
    - frontends: bridge creation and option parsing (command line arguments) are now specified by the frontend in QuickApp __init__
    - frontends: ProfileManager manage a more complete plug sequence (some stuff formerly manage in contact_list have moved to ProfileManager)
    - quick_frontend (quick_widgets): QuickWidgetsManager is now iterable (all widgets are then returned), or can return an iterator on a specific class (return all widgets of this class) with getWidgets
    - frontends: tools.jid can now be used in Pyjamas, with some care
    - frontends (XMLUI): profile is now managed
    - core (memory): big improvment on entities cache management (and specially resource management)
    - core (params/exceptions): added PermissionError
    - various fixes and improvments, check diff for more details
2015-01-24 01:00:29 +01:00
Goffi
6e144c6458 core: improved roster management + misc:
- updated methods to no use anymore methods deprecated in Wokkel
    - use of full jid when it make sense instead of bare jid
    - getContacts, updateContact and delContact are now asynchronous
2014-12-10 18:32:33 +01:00
Goffi
87b3e413ee core (XMPP): sendMessage refactoring:
- better separation of message sending actions
    - use of more generic exceptions to hook the behaviour (SkipHistory and CancelError)
    - use of raise instead of return
    - use of failure.trap
2014-06-07 16:35:29 +02:00
souliane
0d28c03d27 core, memory, bridge: added profile password + password encryption:
/!\ This changeset updates the database version to 2 and modify the database content!

Description:
    - new parameter General / Password to store the profile password
    - profile password is initialized with XMPP password value, it is stored hashed
    - bridge methods asyncCreateProfile/asyncConnect takes a new argument "password" (default = "")
    - bridge method asyncConnect returns a boolean (True = connection already established, False = connection initiated)
    - profile password is checked before initializing the XMPP connection

    - new private individual parameter to store the personal encryption key of each profile
    - personal key is randomly generated and encrypted with the profile password
    - personal key is decrypted after profile authentification and stored in a Sessions instance
    - personal key is used to encrypt/decrypt other passwords when they need to be retrieved/modified

    - modifying the profile password re-encrypt the personal key
    - Memory.setParam now returns a Deferred (the bridge method "setParam" is unchanged)
    - Memory.asyncGetParamA eventually decrypts the password, Memory.getParamA would fail on a password parameter

TODO:
    - if profile authentication is OK but XMPP authentication is KO, prompt the user for another XMPP password
    - fix the method "registerNewAccount" (and move it to a plugin)
    - remove bridge method "connect", sole "asyncConnect" should be used
2014-05-07 16:02:23 +02:00
souliane
1eeddf5900 better PEP-8 compliance 2014-05-07 15:44:31 +02:00
Goffi
95678d7967 core, plugin XEP-0115: discovery refactoring:
- hashing algorithm of XEP-0115 has been including in core
    - our own hash is still calculated by XEP-0115 and can be regenerated with XEP_0115.recalculateHash
    - old discovery methods have been removed. Now the following methods are used:
        - hasFeature: tell if a feature is available for an entity
        - getDiscoInfos: self explaining
        - getDiscoItems: self explaining
        - findServiceEntities: return all available items of an entity which given (category, type)
        - findFeaturesSet: search for a set of features in entity + entity's items
      all these methods are asynchronous, and manage cache automatically
    - XEP-0115 manage in a better way hashes, and now use a trigger for presence instead of monkey patch
    - new FeatureNotFound exception, when we want to do something which is not available
    - refactored client initialisation sequence, removed client.initialized Deferred
    - added constant APP_URL
    - test_plugin_xep_0033.py has been temporarly deactivated, the time to adapt it
    - lot of cleaning
2014-03-28 18:07:22 +01:00
souliane
d158589881 core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile 2014-03-03 09:59:10 +01:00
Goffi
a280080563 core (sqlite): automatic database update:
- new Updater class check database consistency (by calculating a hash on the .schema), and updates base if necessary
    - database now has a version (1 for current, 0 will be for 0.3's database), for each change this version will be increased
    - creation statements and update statements are in the form of dict of dict with tuples. There is a help text at the top of the module to explain how it works
    - if we are on a development version, the updater try to update the database automaticaly (without deleting table or columns). The Updater.generateUpdateData method can be used to ease the creation of update data (i.e. the dictionary at the top, see the one for the key 1 for an example).
    - if there is an inconsistency, an exception is raised, and a message indicate the SQL statements that should fix the situation.
    - well... this is rather complicated, a KISS method would maybe have been better. The future will say if we need to simplify it :-/
    - new DatabaseError exception
2014-02-23 23:30:32 +01:00
Goffi
b6aaecc5c2 core, bridge: better GenericException handling 2013-12-17 00:56:39 +01:00
Goffi
f7efb167c8 plugin XEP-0050: Ad-Hoc commands first draft (answering part) 2013-12-10 17:25:31 +01:00
souliane
4c30dcf240 core: better handling of profile_key and don't write the param file anymore
- new error ProfileNotSetError and some methods use the default @NONE@ instead of @DEFAULT@
- do not output the .sat/param file anymore, it is not needed and created confusion
- plugin XEP-0054: remove an error message at startup
2013-09-05 21:03:52 +02:00
Goffi
923e755c49 plugin XEP-0055: implementation of Jabber Search 2013-09-08 18:05:19 +02:00
Goffi
8e2f394b5b core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
- new BridgeInitError and BridgeExceptionNoService are in core.exceptions
    - D-Bus NotSupported is catched in bridge, and launch a BridgeInitError
    - BridgeInitError stop SàT core, jp, and quick_frontends with an explanation message.
fix bug 27
2013-06-21 02:00:37 +02:00
Goffi
1cd98e8dea fixed licences in docstrings (they are now in comments) 2013-03-08 00:36:22 +01:00
Emmanuel Gil Peyrot
37f7912520 Fix pep8 support in src/core. 2013-01-18 17:55:35 +01:00
Goffi
181d08f2e4 core, plugin XEP-0054: avatar upload:
- plugin XEP-0054: new setAvatar bridge method
    - new "presence_available" trigger
    - new DataError
2012-12-28 01:00:31 +01:00
Goffi
14d8e07d22 core: renamed badly named ConnectedProfileError 2012-12-16 18:02:43 +01:00
Goffi
fa38394401 core, frontends, bridgen plugins: fixed methods which were unproperly managing multi-profiles
- added profile argument to askConfirmation, actionResult, actionResultExt, entityDataUpdated, confirmationAnswer, getProgress
    - core, frontends: fixed calls/signals according to new bridge API
    - user of proper profile namespace for progression indicators and dialogs
    - memory: getParam* now return bool when param type is bool
    - memory: added getStringParam* to return string instead of typed value
    - core, memory, storage, quick_frontend: getHistory now manage properly multi-profiles
    - plugins XEP-0047, XEP-0054, XEP-0065, XEP-0077, XEP-0096; multi-profiles proper handling
2012-11-10 16:38:16 +01:00
Goffi
b44412ec0d core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
- QuickContactManagement is not used anymore and will be removed, ContactList + Core are used instead
	- disconnected contacts are now displayed in Primitivus (M-d to show/hide them)
	- avatars are temporary unavailable in wix
	- new bridge method: getContactsFromGroup
2012-09-25 00:58:34 +02:00
Goffi
8e8e67f8f3 core: entity cache misc data management + error moved to core.exceptions in memory 2012-08-17 03:07:22 +02:00
Goffi
c5a930b627 Licence modification: the full project is now under AGPL v3+ instead of GPL v3+ 2012-08-01 22:53:02 +02:00
Goffi
52b00f6d6f core: exceptions moved to core
plugin group blog: group blog now manage public microblogs
2012-04-04 00:06:44 +02:00
Renamed from src/exceptions.py (Browse further)