Skip to content

Commit

Permalink
Merge master into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Sep 22, 2024
2 parents b0826d3 + 7a1f923 commit e0f21d8
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ on: [push, pull_request]
jobs:
build-deb-package:

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: build
uses: dawidd6/action-debian-package@v1.4.4
uses: dawidd6/action-debian-package@v1.6.0
with:
# Optional, relative to workspace directory
source_directory: .
# Optional, relative to workspace directory
artifacts_directory: output
# Optional, value from `debian/changelog` is used if not defined
os_distribution: jammy
os_distribution: noble
# Optional, target architecture, defaults to amd64
cpu_architecture: amd64
16 changes: 8 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
os: [macos-12, macos-13, ubuntu-20.04, ubuntu-22.04]
os: [macos-13, ubuntu-22.04, ubuntu-24.04]

steps:
- uses: actions/checkout@v4
Expand All @@ -35,8 +35,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install -qq gettext gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-gtksource-4 gir1.2-pango-1.0 gir1.2-webkit2-4.0 python3 python3-enchant python3-gi python3-yaml
python3 -m pip install setuptools tox
sudo apt-get -y install -qq gettext gir1.2-gdkpixbuf-2.0 gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-gtksource-4 gir1.2-pango-1.0 gir1.2-webkit2-4.1 python3 python3-enchant python3-gi python3-setuptools python3-yaml tox
- name: Install dependencies (macOS)
if: startsWith(matrix.os, 'macos')
Expand All @@ -58,13 +57,14 @@ jobs:
HOMEBREW_NO_INSTALL_UPGRADE: on

- name: Check style
if: matrix.os == 'ubuntu-22.04'
if: matrix.os == 'ubuntu-24.04'
run: |
python3 -m tox -v -e style
tox -v -e style
- name: Run tests
if: matrix.os == 'ubuntu-22.04' # pip on macOS needs --break-system-packages
if: matrix.os == 'ubuntu-24.04' # pip on macOS needs --break-system-packages
run: |
python3 -c "import gi"
python3 -m tox -v -e py
python3 -m pip install .
tox -v -e py
python3 -m venv .venv
./.venv/bin/pip install .
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files

# Static analysis for Python code
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
# E203: whitespace before ':' (not compliant with PEP 8)
Expand All @@ -21,29 +21,29 @@ repos:

# Python code formatter
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.8.0
hooks:
- id: black
exclude: ^rednotebook/external/

# Imports sorter
- repo: https://github.com/pycqa/isort
rev: 5.11.5
rev: 5.13.2
hooks:
- id: isort
exclude: ^rednotebook/journal.py

# Upgrades Python code to a target version
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: ['--py36-plus', '--exit-zero']
exclude: ^rednotebook/external/

# Finds unused Python code
- repo: https://github.com/jendrikseipp/vulture
rev: v2.7
rev: v2.12
hooks:
- id: vulture
exclude: ^rednotebook/external/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.35 (2024-09-22)
* Add option to auto-indent text in editor and activate it by default (#561, #562, Allen Benter, Varunjay Varma).

# 2.34 (2024-09-16)
* Copy/paste text into the correct text field (#677, @jendrikseipp).

Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
rednotebook (2.35-1) UNRELEASED; urgency=low

* New upstream release
* Add option to auto-indent text in editor and activate it by default (#561, #562, Allen Benter, Varunjay Varma).

-- Jendrik Seipp <jendrikseipp@web.de> Sun, 22 Sep 2024 21:24:47 +0200

rednotebook (2.34-1) UNRELEASED; urgency=low

* New upstream release
Expand Down
1 change: 1 addition & 0 deletions rednotebook/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Config(dict):
"leftDividerPosition": 260,
"rightDividerPosition": None,
"cloudMaxTags": 1000,
"autoIndent": 1,
}

obsolete_keys = {
Expand Down
2 changes: 1 addition & 1 deletion rednotebook/gui/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def add_category(self, category):
self.categories.sort(key=utils.sort_asc)

def node_on_top_level(self, iter):
if type(iter) != Gtk.TreeIter:
if isinstance(iter, Gtk.TreeIter):
# iter is a path -> convert to iter
iter = self.tree_store.get_iter(iter)
assert self.tree_store.iter_is_valid(iter)
Expand Down
2 changes: 1 addition & 1 deletion rednotebook/gui/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def insert(self, text, iter=None, overwrite=False, undoing=False):
if iter is None:
self.day_text_buffer.insert_at_cursor(text)
else:
if type(iter) == Gtk.TextMark:
if isinstance(iter, Gtk.TextMark):
iter = self.day_text_buffer.get_iter_at_mark(iter)
self.day_text_buffer.insert(iter, text)

Expand Down
6 changes: 6 additions & 0 deletions rednotebook/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ def load_values_from_config(self):

self.set_font(config.read("mainFont", editor.DEFAULT_FONT))

self.set_auto_indent()

def set_auto_indent(self):
auto_indent = self.journal.config.read("autoIndent") == 1
self.day_text_field.day_text_view.set_auto_indent(auto_indent)

def set_font(self, font_name):
self.day_text_field.set_font(font_name)
self.html_editor.set_font_size(
Expand Down
3 changes: 3 additions & 0 deletions rednotebook/gui/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ def on_options_dialog(self):

self.options.append(TickOption(_("Search as you type"), "instantSearch"))

self.options.append(TickOption(_("Auto indent"), "autoIndent"))

def check_version_action(widget):
utils.check_new_version(
self.main_window.journal, info.version, startup=False
Expand Down Expand Up @@ -379,6 +381,7 @@ def check_version_action(widget):
# Apply some options
self.main_window.cloud.update_lists()
self.main_window.cloud.update(force_update=True)
self.main_window.set_auto_indent()

visible = self.config.read("closeToTray") == 1
self.main_window.tray_icon.set_visible(visible)
Expand Down
2 changes: 1 addition & 1 deletion rednotebook/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _(string):

program_name = "RedNotebook"
tagline = _("A Desktop Journal")
version = "2.34"
version = "2.35"
author = "Jendrik Seipp"
author_mail = "jendrikseipp@gmail.com"
copyright_ = "Copyright (c) 2008-2024 Jendrik Seipp"
Expand Down

0 comments on commit e0f21d8

Please sign in to comment.