Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
suurjaak committed Jul 25, 2022
2 parents 2b53445 + fd0a28a commit 3a5e15c
Show file tree
Hide file tree
Showing 33 changed files with 1,316 additions and 1,023 deletions.
788 changes: 400 additions & 388 deletions CHANGELOG.md

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,31 @@ or, to run from source code:

### Linux ###

#### snap ####

* install Snap if not installed: `sudo apt-get install snap`
* install Skyperious from the Snap Store, or run `snap install skyperious`
* launch Skyperious from OS menu, or run `skyperious`


#### source ####

The graphical interface needs wxPython, best installed with one of the prepared
Python wheels available at https://extras.wxpython.org/wxPython4/extras/linux.

E.g. installing Skyperious for Ubuntu 20.04:

* run `sudo apt-get install libgtk-3-0 libsdl2-2.0 libwebkit2gtk-4.0 python3 python3-pip`
* run `sudo pip install wxPython --find-links \`
`https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04`
* run `sudo apt-get install libgtk-3-0 libsdl2-2.0 libsm6 libwebkit2gtk-4.0-37
libxtst6 python3 python3-pip`
* run `sudo pip install wxPython --find-links
https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04`
* run `sudo pip install skyperious`
* run `skyperious`

Another option is to have wxPython built locally, e.g. for Ubuntu 20.04:

* run `sudo apt-get install build-essential libgtk-3-dev libsdl2-dev \`
`libwebkit2gtk-4.0-dev python3 python3-pip`
* run `sudo apt-get install build-essential libgtk-3-dev libsdl2-dev
libwebkit2gtk-4.0-dev python3 python3-pip`
* run `pip install skyperious`
* run `skyperious`

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ no longer affect what is visible in the official Skype program.
---


Skyperious is a Skype chat history tool, written in Python.
Skyperious is a Skype chat history tool.

You can open Skype SQLite databases and work with their contents:

Expand Down Expand Up @@ -126,6 +126,9 @@ Installation
Windows: download and launch the latest setup from
https://suurjaak.github.io/Skyperious/downloads.html.

Linux Snap Store: install Skyperious, or run
`snap install skyperious`

Mac/Linux/other: install Python, wxPython, pip, and run
`pip install skyperious`

Expand Down
28 changes: 14 additions & 14 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@
# and running afterwards:
#
# xhost +
# docker run -it --rm --net=host --mount src=/,target=/mnt/host,type=bind -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ skyperious
# docker run -it --rm --net=host --mount source=/,target=/mnt/host,type=bind -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ skyperious
#
# Add 'sudo' before docker commands if current user does not have rights for Docker.
#
# Add '--mount src="path to host directory",target=/etc/skyperious' after 'docker run'
# to retain Skyperious configuration in a host directory between runs.
# Add '--mount source="path to host directory",target=/etc/skyperious' after 'docker run'
# to retain Skyperious configuration in a host directory between runs,
# e.g. '--mount source=~/.config/skyperious,target=/etc/skyperious'.
#
# Host filesystem is made available under /mnt/host.

FROM ubuntu:20.04

RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
RUN DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
libgtk-3-0 \
libsm6 \
libsdl2-2.0 \
libwebkit2gtk-4.0-37 \
libxtst6 \
python3 \
python3-pip
python3-pip \
&& rm -rf /var/lib/apt/lists/*

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN pip install wxPython==4.1.1 \
RUN pip install wxPython==4.1.1 --no-cache-dir \
--find-links https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04

RUN pip install skyperious

RUN printf '\nConfigFile = "/etc/skyperious/skyperious.ini"\n' \
>> /usr/local/lib/python3.8/dist-packages/skyperious/conf.py
RUN pip install skyperious --no-cache-dir

VOLUME /etc/skyperious

CMD /usr/local/bin/skyperious
CMD /usr/local/bin/skyperious --config-file /etc/skyperious/skyperious.ini
7 changes: 4 additions & 3 deletions build/README for Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build and run the Docker image:
docker build . -t skyperious
xhost +
docker run -it --rm --net=host --mount src=/,target=/mnt/host,type=bind -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ skyperious
docker run -it --rm --net=host --mount source=/,target=/mnt/host,type=bind -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ skyperious
```

`docker build . -t skyperious` will prepare an Ubuntu 20.04 Docker image
Expand All @@ -23,8 +23,9 @@ and install Skyperious and its dependencies within the container.

Add `sudo` before docker commands if current user does not have rights for Docker.

Add `--mount src="path to host directory",target=/etc/skyperious` after `docker run`
to retain Skyperious configuration in a host directory between runs.
Add `--mount source="path to host directory",target=/etc/skyperious` after `docker run`
to retain Skyperious configuration in a host directory between runs,
e.g. `--mount source=~/.config/skyperious,target=/etc/skyperious`.

Host filesystem is made available under `/mnt/host`.

Expand Down
2 changes: 1 addition & 1 deletion build/README for Windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ no longer affect what is visible in the official Skype program.
---


Skyperious is a Skype chat history tool, written in Python.
Skyperious is a Skype chat history tool.

You can open Skype SQLite databases and work with their contents:

Expand Down
10 changes: 5 additions & 5 deletions build/skyperious.desktop
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=skyperious
Name=Skyperious
Icon=skyperious
GenericName=Skype chat history tool
Keywords=Skype SQLite SQLite3
Type=Application
Categories=Utility;Database;InstantMessaging;Chat;GTK;
Icon=res/Icon256x256_32bit.png
Exec=skyperious
68 changes: 68 additions & 0 deletions build/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Snapcraft build file for Skyperious.
#
# To prepare the build environment, execute the following in project directory:
#
# mkdir -p snap/gui && cp build/snapcraft.yaml snap/ && cp build/skyperious.desktop snap/gui/ \
# && cp res/Icon256x256_32bit.png snap/gui/skyperious.png \
# && sed -i 's/Icon=.*/Icon=${SNAP}\/meta\/gui\/skyperious.png/' snap/gui/skyperious.desktop
#
# To build, execute the following in project directory:
#
# snapcraft snap
#
#
# @author Erki Suurjaak
# @created 01.05.2022
# @modified 24.07.2022
name: skyperious
title: Skyperious
summary: Skype chat history tool
website: https://suurjaak.github.io/Skyperious
license: MIT
description: |
Skyperious is a Skype chat history tool.
You can open Skype SQLite databases and work with their contents:
- import messages from Skype online service and Skype export archives
- search across all messages and contacts
- read chat history in full, see chat statistics and word clouds
- export chats as HTML, text or spreadsheet
- view any database table and export their data, fix database corruption
- change, add or delete data in any table
- execute direct SQL queries
and
- synchronize messages in two Skype databases, merging their differences
icon: snap/gui/skyperious.png # Icon for Snap store

base: core18 # Ubuntu 18.04 LTS
confinement: strict # 'strict' when ready, else 'devmode'
grade: stable # 'stable' to release into candidate/stable channels, else 'devel'
adopt-info: skyperious # Version info from parts.skyperious

architectures:
- build-on: [amd64, arm64, armhf]

apps:
skyperious:
command: python3 -m skyperious
plugs: [home, network, network-bind, removable-media, unity7]
extensions: [gnome-3-28] # Adds plugs: desktop, desktop-legacy, gsettings, x11, wayland

parts:
skyperious:
source: https://github.com/suurjaak/skyperious.git
plugin: python
stage-packages:
- libgtk-3-0
- libsdl2-2.0-0
- libwebkitgtk-3.0-0
python-packages:
- https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/wxPython-4.1.1-cp36-cp36m-linux_x86_64.whl
requirements:
- /root/project/requirements.txt
override-pull: | # Set build version from current git tag, drop leading letters ("v5.2" -> "5.2")
snapcraftctl pull
snapcraftctl set-version "$(git -C /root/project describe --tags | sed 's/^[a-z]*//i')"
Binary file modified res/Icon.ico
Binary file not shown.
Binary file modified res/Icon24x24_32bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon256x256_32bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon256x256_8bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon32x32_32bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon40x40_32bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon48x48_32bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon64x64_32bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/Icon64x64_8bit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 36 additions & 21 deletions src/skyperious/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@author Erki Suurjaak
@created 26.11.2011
@modified 17.06.2022
@modified 25.07.2022
------------------------------------------------------------------------------
"""
try: from ConfigParser import RawConfigParser # Py2
Expand All @@ -24,8 +24,8 @@

"""Program title, version number and version date."""
Title = "Skyperious"
Version = "5.2"
VersionDate = "17.06.2022"
Version = "5.3.dev17"
VersionDate = "25.07.2022"

if getattr(sys, "frozen", False):
# Running as a pyinstaller executable
Expand All @@ -41,6 +41,9 @@
"""Name of file where FileDirectives are kept."""
ConfigFile = "%s.ini" % os.path.join(ApplicationDirectory, Title.lower())

"""Whether to ignore user-specific config paths."""
ConfigFileStatic = False

"""List of attribute names that can be saved to and loaded from ConfigFile."""
FileDirectives = ["ConsoleHistoryCommands", "DBDoBackup", "DBFiles", "DBSort",
"LastActivePage", "LastSearchResults", "LastSelectedFiles",
Expand Down Expand Up @@ -83,7 +86,7 @@
IsCLIVerbose = False

"""
Is command-line interface using output suitable for non-terminals
Is command-line interface using output suitable for non-terminals
like piping to a file, skips progress bars and user interaction.
"""
IsCLINonTerminal = True
Expand Down Expand Up @@ -370,20 +373,27 @@
WordCloudWordsAuthorMax = 50


def load():
"""Loads FileDirectives from ConfigFile into this module's attributes."""
global Defaults, VarDirectory, ConfigFile
def load(configfile=None):
"""
Loads FileDirectives into this module's attributes.
@param configfile name of configuration file to use from now if not module defaults
"""
global Defaults, VarDirectory, ConfigFile, ConfigFileStatic

try: VARTYPES = (basestring, bool, int, long, list, tuple, dict, type(None)) # Py2
except Exception: VARTYPES = (bytes, str, bool, int, list, tuple, dict, type(None)) # Py3

if configfile:
ConfigFile, ConfigFileStatic = configfile, True
configpaths = [ConfigFile]
if not Defaults:
if not Defaults and not ConfigFileStatic:
# Instantiate OS- and user-specific paths
try:
p = appdirs.user_config_dir(Title, appauthor=False)
userpath = os.path.join(p, "%s.ini" % Title.lower())
# Try user-specific path first, then path under application folder
configpaths.insert(0, os.path.join(p, "%s.ini" % Title.lower()))
if userpath not in configpaths: configpaths.insert(0, userpath)
except Exception: pass
try: VarDirectory = appdirs.user_data_dir(Title, False)
except Exception: pass
Expand All @@ -396,7 +406,7 @@ def load():
parser = RawConfigParser()
parser.optionxform = str # Force case-sensitivity on names
try:
for path in configpaths[::-1]:
for path in configpaths:
if os.path.isfile(path) and parser.read(path):
break # for path

Expand All @@ -417,16 +427,21 @@ def parse_value(name):
pass # Fail silently


def save():
"""Saves FileDirectives into ConfigFile."""
configpaths = [ConfigFile]
try:
p = appdirs.user_config_dir(Title, appauthor=False)
userpath = os.path.join(p, "%s.ini" % Title.lower())
# Pick only userpath if exists, else try application folder first
if os.path.isfile(userpath): configpaths = [userpath]
else: configpaths.append(userpath)
except Exception: pass
def save(configfile=None):
"""
Saves FileDirectives into configuration file.
@param configfile name of configuration file to use if not module defaults
"""
configpaths = [configfile] if configfile else [ConfigFile]
if not configfile and not ConfigFileStatic:
try:
p = appdirs.user_config_dir(Title, appauthor=False)
userpath = os.path.join(p, "%s.ini" % Title.lower())
# Pick only userpath if exists, else try application folder first
if os.path.isfile(userpath): configpaths = [userpath]
elif userpath not in configpaths: configpaths.append(userpath)
except Exception: pass

section = "*"
module = sys.modules[__name__]
Expand All @@ -441,7 +456,7 @@ def save():
except Exception: continue # for path
else: break # for path

f.write("# %s configuration written on %s.\n" %
f.write("# %s configuration written on %s.\n" %
(Title, datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
for name in FileDirectives:
try: parser.set(section, name, json.dumps(getattr(module, name)))
Expand Down
4 changes: 2 additions & 2 deletions src/skyperious/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def make_filename(chat):
else:
filedir = path if opts.get("multi") else os.path.dirname(path)
if not os.path.exists(filedir): util.try_ignore(os.makedirs, filedir)
export_func = (export_chats_xlsx if "xlsx" == format else
export_func = (export_chats_xlsx if "xlsx" == format else
export_chat_csv if "csv" == format else
export_chat_template)

Expand Down Expand Up @@ -457,7 +457,7 @@ def export_grid(grid, filename, title, db, sql_query="", table=""):
replacer = lambda m: ("%sIF NOT EXISTS " % m.group(1))
namespace["create_sql"] = re_sql.sub(replacer, create_sql)

template = step.Template(templates.GRID_HTML if is_html else
template = step.Template(templates.GRID_HTML if is_html else
templates.SQL_TXT, strip=False, escape=is_html)
template.stream(f, namespace, newline=os.linesep)

Expand Down
Loading

0 comments on commit 3a5e15c

Please sign in to comment.