Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c63d3324 by Philipp Hörist at 2023-01-02T22:26:09+01:00
ci: Add isort config
- - - - -
26afcb62 by Philipp Hörist at 2023-01-02T22:31:33+01:00
ci: Update pre-commit config
- - - - -
756b0008 by Philipp Hörist at 2023-01-03T00:35:54+01:00
cq: Fix typos
- - - - -
12 changed files:
- .ci/link-gtk.py
- .pre-commit-config.yaml
- CONTRIBUTING.md
- ChangeLog
- README.md
- gajim/common/ged.py
- gajim/common/helpers.py
- gajim/gtk/preview_audio.py
- pyproject.toml
- scripts/generate_ui_types.py
- test/no_gui/test_gtk_util.py
- test/no_gui/test_styling.py
Changes:
=====================================
.ci/link-gtk.py
=====================================
@@ -13,7 +13,7 @@
cwd = Path.cwd()
if cwd.name != 'gajim':
- sys.exit('Script needs to be excecuted from gajim repository '
+ sys.exit('Script needs to be executed from gajim repository '
'root directory')
gui_path = cwd / 'gajim' / 'gui'
=====================================
.pre-commit-config.yaml
=====================================
@@ -3,6 +3,8 @@ repos:
rev: v0.0.206
hooks:
- id: ruff
+ exclude: ".githooks/"
+ args: ["--force-exclude"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
@@ -15,3 +17,15 @@ repos:
rev: v1.1.286
hooks:
- id: pyright
+ pass_filenames: false
+ additional_dependencies:
+ - nbxmpp @ git+https://dev.gajim.org/gajim/python-nbxmpp.git
+ - PyGObject-stubs @ git+https://github.com/pygobject/pygobject-stubs.git
+ - python-gitlab
+ - sentry-sdk
+ stages: [manual]
+
+ - repo: https://github.com/pycqa/isort
+ rev: 5.11.4
+ hooks:
+ - id: isort
=====================================
CONTRIBUTING.md
=====================================
@@ -61,7 +61,7 @@ # Commit Messages
# Use pre-commit
-Execute the following inside the repositor dir
+Execute the following inside the repository dir
$ pip install pre-commit
$ pre-commit install
=====================================
ChangeLog
=====================================
@@ -121,7 +121,7 @@ Gajim 1.5.3 (31 Oct 2022)
* Notification: Draw avatar correctly on scale > 1 (#11229)
* Preview: Don’t fail hard when parsing fragments
* PreviewAudio: Increase update rate for seek bar (#11215)
- * AccountPage: Disable Excute Command button by default (#11216)
+ * AccountPage: Disable Execute Command button by default (#11216)
* Client: Load trusted certificates on connect() (#11220)
* ChatList: Don’t increase in width while drag and drop
* Roster: Always show workspace when starting chat
@@ -561,7 +561,7 @@ Gajim 1.4.0 (11 May 2022)
* #8584 Display vcard-temp JABBERIDs somewhere
* #8631 Vertical tabs can not be adjusted in width in latest master
* #8742 Integrate the Appindicator plugin into Gajim
- * #8745 Allow successive bookmarked MUC autojoins (in oposite to concurrent)
+ * #8745 Allow successive bookmarked MUC autojoins (in opposite to concurrent)
* #8849 Error when disabling an account: Account iter of <the server> could not be found
* #8897 Roster filter crashes
* #8898 Roster tree elements have wrong collapse state during and after roster filtering
@@ -569,11 +569,11 @@ Gajim 1.4.0 (11 May 2022)
* #9041 HTTPUpload: Add upload button to contact right-click menu
* #9046 Add a "Minimize on close" in Preferences for all MUC rooms
* #9145 Roster not showing number of contacts logged in per group
- * #9164 Chatstates: Color of tab as "typing/composing" indicator get's lost on focus
+ * #9164 Chatstates: Color of tab as "typing/composing" indicator gets lost on focus
* #9174 Changing status results in an error
* #9202 No context menu on MUC's tab
* #9321 Cannot allow contact to see my status
- * #9360 Allow disabling keyboard shorcut ctrl+L (clear chat window)
+ * #9360 Allow disabling keyboard shortcut ctrl+L (clear chat window)
* #9457 Add global search in History window
* #9501 Mark corrected messages (LMC) in history browser
* #9596 Add UI to search history from contact/chat window
@@ -599,7 +599,7 @@ Gajim 1.4.0 (11 May 2022)
* #10166 AttributeError: 'NoneType' object has no attribute 'show'
* #10205 Restoring conversation tabs fails if JID contains comma
* #10236 MUC: Error in update_actions when clicking on tray notification
- * #10242 Bug with roster: Repeating error message: "too many values to unpack (exptected 2)"
+ * #10242 Bug with roster: Repeating error message: "too many values to unpack (expected 2)"
* #10248 logind timeout error (24) in _inhibit_sleep
* #10249 StatusIcon: Show connection lost icon when at least one account is not connected
* #10279 error after wake-up from hibernation
@@ -607,7 +607,7 @@ Gajim 1.4.0 (11 May 2022)
* #10450 Clicking a link in the message window can cause Gajim 1.3 to crash
* #10452 Various contact list issues
* #10455 App crashing if quit from tray in Windows
- * #10461 TypeError: can only concatenate str (not "NoneType") to str when receving bare jid presence from localpart(a)component.domain.tld
+ * #10461 TypeError: can only concatenate str (not "NoneType") to str when receiving bare jid presence from localpart(a)component.domain.tld
* #10472 ConfirmationCheckDialog: DELETE_EVENT does not propagate checkbox state
* #10483 Don't interrupt onboarding with update dialog
* #10490 Gajim does not send XHTML in MUC
@@ -852,7 +852,7 @@ Gajim 1.2.1 (08 July 2020)
* ServerInfo: Display status address
* Add block and spam reporting in various places
* Roster: Allow to add contacts from `Not in contact list` group via DND
- * Roster: Allow sending message to serveral groups
+ * Roster: Allow sending message to several groups
* Groupchat/Chat: Rework DND
* Groupchat: Display recent history from the database
@@ -1009,12 +1009,12 @@ Gajim 1.1.0-beta2 / 1.0.99.1 (13 October 2018)
* Support more media players for broadcasting the current tune
* Windows: Add a debug logging switch in preferences
* Preferences: enable/disable dark theme
- * Preferences: enable/disable the MUC subject beeing shown on join
+ * Preferences: enable/disable the MUC subject being shown on join
* Preferences: enable/disable ascii emoji conversion
Bug fixes
- * #9198 Creating new MUCs with captial letters is not possible
+ * #9198 Creating new MUCs with capital letters is not possible
* #9210 Error when clicking on new message indicator
* #9280 Inviting users to a MUC causes error
* #9301 Error when opening service discovery window
@@ -1047,7 +1047,7 @@ Gajim 1.1.0-beta1 / 1.0.99 (19 August 2018)
Bug fixes
- * #8658 Translation doesnt work on Windows
+ * #8658 Translation doesn't work on Windows
* #8750 Increase time frame for duplicate search in MUCs
* #9138 Translation in Flatpak does not work
* #9140 Error when clicking on the notification of an incoming message
@@ -1108,10 +1108,10 @@ Gajim 1.0.2 (30 April 2018)
* #9055 Removing a bookmark causes error
* #9057 Avatar is deleted when updating vCard
* #9065 Account label isn't change in tooltip of notification area icon
- * #9066 Placeholder text does't disappear
+ * #9066 Placeholder text doesn't disappear
* #9068 Missing pulseaudio in Flatpak image
* #9070 Fix History Manager search
- * #9074 Proxy comobobox in accounts/connections doesn't get update after ManageProxies
+ * #9074 Proxy comobo-box in accounts/connections doesn't get update after ManageProxies
* #9094 problem receiving file
* #9101 Notification never autohides in gnome
@@ -1207,7 +1207,7 @@ Gajim 0.16.6 (02 October 2016)
Gajim 0.16.5 (28 December 2015)
* Improve MAM implementation
- * Improve security on connexion and for roster managment
+ * Improve security on connection and for roster management
* Ability for emoticons to be sorted in menu
Gajim 0.16.4 (26 September 2015)
@@ -1282,7 +1282,7 @@ Gajim 0.15 (18 March 2012)
* Plugin system
* Whiteboard (via a plugin)
* Message archiving
- * Stream managment
+ * Stream management
* IBB
* Nested roster group
* Roster filtrering
@@ -1299,7 +1299,7 @@ Gajim 0.14.3 (19 June 2011)
* Fix history viewer
* Fix closing roster window
- * Prevent some erros with metacontacts
+ * Prevent some errors with metacontacts
Gajim 0.14.2 (07 June 2011)
@@ -1429,7 +1429,7 @@ Gajim 0.12 (17 December 2008)
* Better auto-away support
* Fix banshee support
* Quodlibet support
- * Fix GSSAPI authentification
+ * Fix GSSAPI authentication
* Fix IPV4 filetransfer on Windows Vista when IPV6 is used too
* Fix caps usage
* Fix end to end encryption autonegotiation
@@ -1533,7 +1533,7 @@ Gajim 0.11.2 (22 September 2007)
* Improve idle, transports support
* Enable ellipsization in roster and chatwindow
* Fixed some metacontacts problems (#2156, #2761)
- * Beter support of XEP-0070 (Verifying HTTP Requests via XMPP)
+ * Better support of XEP-0070 (Verifying HTTP Requests via XMPP)
* Make the same height of a banner for all chat tabs
* Fix a bug with french translation and invitations (#3043)
* Fix a bug with UTF-8 and emoticons
@@ -1573,7 +1573,7 @@ Gajim 0.11 (19 December 2006)
* Completion for "Start Chat" input dialog
* Metacontacts across accounts (#1596)
* Ability to have a different spellchecking language in each chat window. (#2383 and #746)
- * Forbid to run multiple instances (but you can use differents profiles)
+ * Forbid to run multiple instances (but you can use different profiles)
* Ability to save avatar with right click on avatar in chat banner
* Annotations (XEP-0145)
* XHTML Support
@@ -1581,7 +1581,7 @@ Gajim 0.11 (19 December 2006)
* Ability to operate on more than one contact at once in roster (#1514)
* Send single message to a whole group
* Delete a whole group
- * Gajim now remembers if GPG encyption was enabled per contact
+ * Gajim now remembers if GPG encryption was enabled per contact
* Priority can be changed automatically when we change status
* Fuzzyclock support
* Mute sounds from systray menu
@@ -1685,7 +1685,7 @@ Gajim 0.8 (18 Aug 2005)
Gajim 0.7.1 (5 Jun 2005)
- * Transports icon as an option and error/mesage icon for transports
+ * Transports icon as an option and error/message icon for transports
* Gajim is more HIG compatible
* Editing registration information on transports
* Messages stanza without <body> element are not printed
=====================================
README.md
=====================================
@@ -78,13 +78,13 @@ #### Mac
#### Developing
-To create a virutalenv you can execute
+To create a virtualenv you can execute
./scripts/dev_env.sh
Be sure all install requirements are available.
-Afterwards activate the vitual environment with
+Afterwards activate the virtual environment with
source .venv/bin/activate
./launch.py
=====================================
gajim/common/ged.py
=====================================
@@ -79,7 +79,7 @@ def remove_event_handler(self,
except ValueError as error:
log.warning(
'''Function (%s) with priority "%s" never
- registered as handler of event "%s". Couldn\'t remove.
+ registered as handler of event "%s".
Error: %s''', handler, priority, event_name, error)
def raise_event(self, event_obj: ApplicationEvent) -> Any:
=====================================
gajim/common/helpers.py
=====================================
@@ -924,7 +924,7 @@ def parse_uri(uri: str) -> URI:
data: dict[str, str] = {}
try:
data['addr'] = unquote(urlparts.path, errors='strict')
- validate_jid(data['addr'], 'bare') # meh, good enuf
+ validate_jid(data['addr'], 'bare') # meh, good enough
except ValueError as err:
data['error'] = str(err)
return URI(URIType.INVALID, uri, data=data)
=====================================
gajim/gtk/preview_audio.py
=====================================
@@ -186,7 +186,7 @@ def _update_duration(self, duration: float):
def _setup_audio_player(self, file_path: Path) -> None:
assert self._playbin is not None
- # Set up the whole pipline
+ # Set up the whole pipeline
# For reference see
# https://gstreamer.freedesktop.org/
# documentation/audiofx/scaletempo.html
=====================================
pyproject.toml
=====================================
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[tool.codespell]
-skip = "*__pycache__*,gajim/gui,gajim/data/icons,gajim/data/sounds"
+skip = "*__pycache__*,test,*.egg-info,.git,*.po,*.nsi,*.spec"
ignore-words-list = "claus,pres,ser,trough"
@@ -170,3 +170,11 @@ max-complexity = 15
inline-quotes = "single"
docstring-quotes = "single"
multiline-quotes = "single"
+
+[tool.isort]
+force_alphabetical_sort_within_sections = true
+force_single_line = true
+group_by_package = true
+known_typing = ["typing"]
+sections = ["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
+skip_gitignore = true
=====================================
scripts/generate_ui_types.py
=====================================
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# Reads all .ui files and creates builder.pyi
-# Excecute this script from the repo root dir
+# Execute this script from the repo root dir
import logging
import sys
@@ -16,7 +16,7 @@
cwd = Path.cwd()
if cwd.name != 'gajim':
- sys.exit('Script needs to be excecuted from gajim repository '
+ sys.exit('Script needs to be executed from gajim repository '
'root directory')
in_path = cwd / 'gajim' / 'data' / 'gui'
=====================================
test/no_gui/test_gtk_util.py
=====================================
@@ -64,7 +64,7 @@ def test_get_first_grapheme(self):
self.assertEqual(
get_first_grapheme(devanagari_kshi), '\u0915\u094D', 'क्षि -> क् ')
# This probably won't fail on *any* locale, ever, again because the
- # implementaion doesn't seem locale-specific.
+ # implementation doesn't seem locale-specific.
if __name__ == '__main__':
=====================================
test/no_gui/test_styling.py
=====================================
@@ -486,7 +486,7 @@
r'somenick!user\22\26\27\2f\3a\3c\3e\5c3address(a)example.com',
# https://en.wikipedia.org/wiki/E-mail_address#Internationalization_examples
- # Do note that these are *e-mail* addresses and might not all be vaild JIDs.
+ # Do note that these are *e-mail* addresses and might not all be valid JIDs.
'Pelé(a)example.com',
'δοκιμή(a)xn--hxajbheg2az3al.xn--jxalpdlp',
'我買(a)xn--hoqu73a.xn--j6w193g',
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/7bf5267cf22600c38500c8ac311e2ac…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/7bf5267cf22600c38500c8ac311e2ac…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0ef3cf9d by Philipp Hörist at 2023-01-02T20:17:19+01:00
ci: Add pre-commit config
- - - - -
2 changed files:
- + .pre-commit-config.yaml
- CONTRIBUTING.md
Changes:
=====================================
.pre-commit-config.yaml
=====================================
@@ -0,0 +1,17 @@
+repos:
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
+ rev: v0.0.206
+ hooks:
+ - id: ruff
+
+ - repo: https://github.com/codespell-project/codespell
+ rev: v2.2.2
+ hooks:
+ - id: codespell
+ additional_dependencies:
+ - tomli
+
+ - repo: https://github.com/RobertCraigie/pyright-python
+ rev: v1.1.286
+ hooks:
+ - id: pyright
=====================================
CONTRIBUTING.md
=====================================
@@ -59,6 +59,19 @@ # Commit Messages
`feat: New Button which does something`
+# Use pre-commit
+
+Execute the following inside the repositor dir
+
+ $ pip install pre-commit
+ $ pre-commit install
+
+Now pre-commit will run various checks before code can be committed.
+
+To update to the newest versions
+
+ $ pre-commit autoupdate
+
# Man Pages
Man pages are written in markdown and converted with pandoc
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0ef3cf9d5e9d4badd086fb637ede0b52…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0ef3cf9d5e9d4badd086fb637ede0b52…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d7d80b47 by Philipp Hörist at 2023-01-02T19:22:29+01:00
cq: Use OSError instead of alias
- - - - -
3 changed files:
- gajim/common/jingle_ft.py
- gajim/common/modules/bytestream.py
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/common/jingle_ft.py
=====================================
@@ -289,7 +289,7 @@ def _compute_hash(self) -> Optional[nbxmpp.Hashes2]:
return
try:
file_ = open(self.file_props.file_name, 'rb')
- except IOError:
+ except OSError:
# can't open file
return
h = nbxmpp.Hashes2()
=====================================
gajim/common/modules/bytestream.py
=====================================
@@ -360,7 +360,7 @@ def _add_upnp_igd_as_streamhost_to_query(self,
# check if we are connected with an IPv4 address
try:
socket.inet_aton(my_ip)
- except socket.error:
+ except OSError:
self._con.connection.send(iq)
return
=====================================
gajim/plugins/pluginmanager.py
=====================================
@@ -572,7 +572,7 @@ def install_from_zip(self,
except zipfile.BadZipfile:
# it is not zip file
raise PluginsystemError(_('Archive corrupted'))
- except IOError:
+ except OSError:
raise PluginsystemError(_('Archive empty'))
if zip_file.testzip():
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d7d80b47d867577378e91d3993c901a5…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d7d80b47d867577378e91d3993c901a5…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
1dbc2ed4 by Philipp Hörist at 2023-01-01T22:12:01+01:00
cfix: HTTP: Handle case where sniffer omits content-type
- - - - -
c3b9bd4e by Philipp Hörist at 2023-01-01T22:21:38+01:00
cfix: HTTP: Store lost content-length again
- - - - -
1 changed file:
- nbxmpp/http.py
Changes:
=====================================
nbxmpp/http.py
=====================================
@@ -403,7 +403,7 @@ class HTTPRequest(GObject.GObject):
def _on_content_sniffed(self,
message: Soup.Message,
- content_type: str,
+ content_type: Optional[str],
_params: GLib.HashTable,
) -> None:
@@ -419,7 +419,14 @@ class HTTPRequest(GObject.GObject):
self.cancel()
return
- self._response_content_type = content_type
+ self._response_content_length = headers.get_content_length()
+
+ if content_type is None:
+ # According to the docs, content_type is None when the sniffer
+ # decides to trust the content-type sent by the server.
+ self._response_content_type = headers.get_content_type()
+ else:
+ self._response_content_type = content_type
self._log.info('Sniffed: content-type: %s, content-length: %s',
self._response_content_type,
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/156a365a688f7e5071c2d1a…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/156a365a688f7e5071c2d1a…
You're receiving this email because of your account on dev.gajim.org.