100 Commits
Author SHA1 Message Date
gryf 3d0961c090 Adjusted reporters to handle files attached to messages. 2019-01-05 17:43:46 +01:00
gryf fe1e2dd230 Adjusting test data/tests for new file attachment way. 2019-01-05 17:30:57 +01:00
gryf 4a3bb067f4 Fix for missing backslash escape 2019-01-05 16:55:42 +01:00
gryf 9ab0dd0da0 File extension rework for downloaded files 2019-01-05 16:52:36 +01:00
gryf 2a2f58680b Adapt to Slack file atachement API changes
Couple of months ago, file attachments was treated differently, than
now - API provides attached files as a list, instead of single object,
and is directly coupled with a message object. This change provides
support for such cases.
2019-01-05 16:48:36 +01:00
gryf 5499ee0937 Unifying switches and config options.
There was a rule for command line switches, and for ini file options,
where in command line options words are separated with hyphen and in ini
files options are separated with underscore. This rule wasn't always
enforced, fixed it now.
2018-09-27 20:23:10 +02:00
gryf 431621edb0 Fix issue with url_file_to_attachment and generating raport. 2018-09-27 20:15:44 +02:00
gryf 40c896a01e Fix for raw format function 2018-07-17 09:06:55 +02:00
gryf 9aa79bfa89 Fix: Ignore deleted channels 2018-07-16 16:16:03 +02:00
gryf 93b0bc2dd7 Added raw-dir option
This option can be used to debug slack API responses - if set,
slack-backup will dump all of the data as a JSON in provided direcotry.
2018-07-16 16:11:27 +02:00
gryf db8527e9af Added implementation for url_file_attachment option.
Using url_file_attachment user can specify if he like to change objects
like 'file_share' marked as external (in Slack servers point of view)
to attachments, so the only value would be remembered URL for the
"uploaded" document as an attachment. Or, treat it as is, and let the
slack-backup to produce file which contain the URLs and corresponding
local file names for such files.
2018-07-16 15:20:45 +02:00
gryf 71355b1c4a Added new option - url_file_to_attachement
Currently, if message contain shared file, slack-backup will try to
download it. If it fail, than empty file will remain, which will be at
least confusing. This will mostly happen for shares which are not
uploaded to the slack servers.

New option will be used to indicate if slack-backup should convert such
share as an attachment, or to save the list of URL and their
destination in local file system to be download manually by the user.
2018-05-22 22:26:53 +02:00
gryf 007fe04c08 Use as_uri only for absolute file paths, not random strings. 2018-05-05 16:13:17 +02:00
gryf 5e7f4740ed Use utils fromtimestamp function for creating datetime objects.
This fixes OSError exception on Windows when timestamps returned by
slack API are set to 0.
2018-05-03 18:47:14 +02:00
gryf c33d2fad50 Moved fromtimestamp function to utils module 2018-05-03 18:44:25 +02:00
gryf 43b830c3d1 Log data on failures. 2018-05-03 11:22:12 +02:00
gryf 03972e609f Fix for skipping messages for attachements. 2018-05-03 10:41:07 +02:00
gryf 641d67065c Treat bot user equally to regular users.
Currently, if messages are generated using bot users, such messages will
crash slack_backup, since user.list API method returns only regular
users. In this commit there is detected a situation, where we have
'bot_id' in the data, and in case there is no such user in local
database, create it using data from bot.info API call.
2018-05-03 10:24:57 +02:00
gryf a57d5085b1 Explicitly open log files with utf8 encoding 2018-05-01 12:41:02 +02:00
gryf 05799e9dfe Use pathlib for providing uri 2018-05-01 12:38:07 +02:00
gryf c0c1e7c881 Fixed issue with fromtimestamp under Windows 2018-05-01 11:58:42 +02:00
gryf 6a261c2d21 Fixes for links handling 2018-03-11 13:30:11 +01:00
gryf 39b16e68a5 Added simple html reporter 2018-03-11 12:47:11 +01:00
gryf ce8cd4a786 Small fixes for generating procedure, re-added emoji substitution 2018-03-11 12:46:10 +01:00
gryf 7b3a4d1f68 Moved message data generators to base class 2018-03-11 11:59:08 +01:00
gryf dcf957fc75 Fix for selecting channels log to generate 2018-03-10 19:16:58 +01:00
gryf 3e5dfb13cf Helper Reporter methods _msg* now returns dict instead of string 2018-03-10 19:10:35 +01:00
gryf 59ae9c7046 Introducing templates for message lines 2018-03-10 18:57:19 +01:00
gryf 710142d3d7 Moved write_message to Reporter base class 2018-03-10 18:48:55 +01:00
gryf 8b133ab16a Fix tox and tests 2018-03-10 18:39:50 +01:00
gryf 37aca84605 Added NoneReporter 2018-03-10 18:39:29 +01:00
gryf 57db9b69f6 Fix a way how users and URLs are treated in report
In case of user replacement there was a bunch of regular expressions
used, which was an overkill. Substituted them with one generic regexp.

Moved method which is responsible for substitution to the base class.

Last change is a cosmetic one - uploaded files are represented as
absolute path with file:// prefix, so that it is easier to open it with
xdg-open for example.
2018-03-10 17:45:31 +01:00
gryf 0ffb9f9406 Version bump to 0.7 2018-01-25 19:02:15 +01:00
gryf 2475bb029d Merge pull request #2 from lhl/master
Uploaded cookie check for logins
2018-01-24 22:06:19 +01:00
gryf 9a3c80333d Version bump 2017-11-01 18:46:33 +01:00
gryf b2048b03e0 Changed behavoiur for duplicates
Till now, if we download certain files (like those attached to the
conversation) and we already have the file with the same name, number in
format '%03d' was added just before extension. That way there could be
possibility, that the very same file will be downloaded and stored
multiple times, like:

file.png
file.001.png
file.002.png
...

This commit prevents that by adding comparison between files we already
have and file which is downloaded from slack. Adding another file with
additional number will only have place when stored file and downloaded
have different content.
2017-11-01 18:40:52 +01:00
gryf a077317cb4 Added retry mechanism for getting assets 2017-11-01 18:38:31 +01:00
gryf ce2888d441 Added colors for loglevels 2017-11-01 12:45:35 +01:00
gryf f2a78f4a52 Add message body to log 2017-11-01 11:27:01 +01:00
gryf 64d4b09468 Fix for handling messages of different types than 'message' 2017-08-06 09:22:38 +02:00
gryf 5f9f290ba4 Fix for message comment.
If comment is sent by the user, different structure of the data is sent.
First of all, the type of this message is "message", but it contain
dictionary under 'comment' key, which can be confusing, which contain
needed data (like user id). For this kind of messages, in case of lack
of 'user' in main dict, dict['comment']['user'] will be used for getting
user identifier, while dict['text'] remains as a message text.
2017-02-13 19:57:31 +01:00
gryf 9ddd470b54 Move commands functions to its own module 2016-11-28 19:05:26 +01:00
gryf feb773956c Fix for extension of config file 2016-11-28 18:25:41 +01:00
gryf 3f95986981 Fix the tests.
For some reason, database key was treated differently in configparser object
in python 3.4.2. In Python 3.4.5 everything is fine. Fixed the defaults to
make sure all string options are treated equally.
2016-11-28 18:14:47 +01:00
gryf 6d5f3746a2 Superfast fix for non-existed config parameter in cmdline options 2016-11-28 17:20:14 +01:00
gryf 7ccc2bddaa Added section about config in readme 2016-11-28 16:54:48 +01:00
gryf db658f917f Added manifest 2016-11-27 20:52:34 +01:00
gryf 8568b552ca Readme update 2016-11-27 20:39:47 +01:00
gryf c1c4581248 Added config file 2016-11-27 20:39:20 +01:00
gryf b5e9c150ed Merge to head 2016-11-26 19:23:03 +01:00
gryf af7f24e9a9 Dropping Python 2 support 2016-11-26 19:13:12 +01:00
gryf 11241e9d8b Readme update 2016-11-26 18:40:54 +01:00
gryf c8c1dd4bfe Small fixes, version bump, alpha stage, added emoji map. 2016-11-26 18:03:29 +01:00
gryf c79d8ae0e1 Small fixes, version bump, alpha stage, added emoji map. 2016-11-26 17:57:58 +01:00
gryf 832b76fc84 Added forgotten utils module 2016-11-26 16:10:45 +01:00
gryf 2610853459 Readme update 2016-11-26 15:14:13 +01:00
gryf 137f9bbac6 Fix for files object db store 2016-11-26 15:13:43 +01:00
gryf 2c6979f2b5 Fix for one-to-one relationship between message and file objects 2016-11-26 15:11:12 +01:00
gryf 352a88dcce Implementation of TextReporter 2016-11-26 15:10:19 +01:00
gryf ea923c7351 Version bump 2016-11-26 15:08:53 +01:00
gryf 7b76480c85 Added subcommands for slack-backup 2016-11-26 15:08:36 +01:00
gryf ac9dee9e5d Fix returned channel list 2016-11-25 09:37:29 +01:00
gryf 267341d6a8 added warning for in-memory db 2016-11-25 07:48:09 +01:00
gryf 97069e0a83 Added reporters module 2016-11-25 07:45:37 +01:00
gryf f3bafadbfe Added install requirements to setup.py 2016-11-24 12:42:04 +01:00
gryf 9c616b8da6 Update messages to call for download assets 2016-11-24 08:50:15 +01:00
gryf ea423a523f Added download logic 2016-11-24 08:49:08 +01:00
gryf 4d71fcb864 Added output and verbose/quite options 2016-11-24 08:48:04 +01:00
gryf 15c48ccb87 Added Attachement object, fixed some sqlite-specific issues 2016-11-24 08:44:18 +01:00
gryf 966380a2f7 Fix for python2.7 environment
Python envs used till now python3 for testing, now version of python
depends on the environment - for py2* python 2.7 will be used, and for
py3* appropriate python3 version will be used.

Also, added mock module for python2 envs.
2016-11-24 08:30:10 +01:00
gryf 87f6eb4d3a Changing the way how arguments are passed 2016-11-23 22:02:49 +01:00
gryf bea61d3b45 Added File objects, some fixes, and download module 2016-11-22 09:27:59 +01:00
gryf 85a42ef143 Renamed test_users to more suitable name 2016-11-21 14:05:53 +01:00
gryf f3173b9cc9 Added more test data to the tests 2016-11-21 14:04:15 +01:00
gryf f7fb9d32a8 Added message model, moving updates of users and channels as public methods 2016-11-21 14:03:19 +01:00
gryf 79cf5f1620 added email field to Profile 2016-11-21 09:36:12 +01:00
gryf c3ae7607eb Renamed get_hostory to update_history 2016-11-21 09:35:30 +01:00
gryf 29b214ce74 Added channels and format options 2016-11-21 09:32:34 +01:00
gryf 25a4d374f7 Readme update 2016-11-20 16:41:02 +01:00
gryf 970795bbf4 Fix env name for travis 2016-11-20 16:37:41 +01:00
gryf 93771e9cbf Added travis conf file 2016-11-20 16:35:29 +01:00
gryf 25d4de0ca3 Refactoring _update_channels method 2016-11-20 16:09:10 +01:00
gryf cf93a85268 Removed primary key for other fields than id in Topic and Purpose objects 2016-11-20 16:07:11 +01:00
gryf 9d0582a82f Updates to channel creation 2016-11-20 15:15:01 +01:00
gryf 2476af0555 Adjusted get_history method 2016-11-20 15:13:47 +01:00
gryf 07f1b12fa0 Removed IdMap, added slackid column 2016-11-20 15:12:47 +01:00
gryf 71c0866699 Removed shebang 2016-11-20 15:11:56 +01:00
gryf b1969e6f6b Added Channel and corresponding relations 2016-11-20 09:48:20 +01:00
gryf c6f86315c6 Removed cleanup from tox 2016-11-20 09:46:58 +01:00
gryf 5c6dc72d7c added some tests 2016-11-20 09:46:38 +01:00
gryf 162010ac1e Implemented storage and update of User data 2016-11-19 10:38:45 +01:00
gryf 810b7bf002 Removed not needed fields 2016-11-19 09:28:04 +01:00
gryf 25d10c1775 Added tox configuration 2016-11-19 09:13:38 +01:00
gryf e1adfd7a57 Tweaked mapping for topic and purpose 2016-11-19 09:12:55 +01:00
gryf 3055edd0de Added db connection 2016-11-19 09:12:01 +01:00
gryf ab65f84f5f Started to convert objects to SA db objects 2016-11-19 07:51:10 +01:00
gryf d7af2b51ab Added db module 2016-11-19 07:50:05 +01:00
gryf 596d760b65 Added sqlalchemy to requirements 2016-11-19 06:55:29 +01:00
gryf 59457df4f2 Rename script file 2016-11-19 06:55:07 +01:00
gryf d206d1e5e9 Readme update 2016-11-18 19:12:37 +01:00