dave-theunsub / clamtk-gnome

clamtk-gnome is a simple plugin to allow a right-click, context menu scan of files or folders
https://gitlab.com/dave_m/clamtk/wikis/Home
Other
16 stars 5 forks source link

Tord's private todo list #1

Closed SunyataZero closed 8 years ago

SunyataZero commented 8 years ago
SunyataZero commented 8 years ago

Tutorials

GTK + Python

Nautilus + Python

SunyataZero commented 8 years ago

Glitches and warning, etc

"unresolved reference" for some imports

https://www.google.se/search?client=ubuntu&channel=fs&q=from+import+pycharm+%22unresolved+reference%22&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=7TrVV_P2KuPk8Aet0KX4Cw#channel=fs&q=%22from+gi.repository+import%22+pycharm+%22unresolved+reference%22

No nautilus version limitation

Warning:

sys:1: PyGIWarning: Nautilus was imported without specifying a version first. Use gi.require_version('Nautilus', '3.0') before import to ensure that the right version gets loaded.
SunyataZero commented 8 years ago

Inspiration

https://github.com/brunonova/nautilus-admin https://github.com/dropbox/nautilus-dropbox https://launchpad.net/ubuntu/+source/gnome-mplayer/+index Under "Community": https://wiki.gnome.org/Projects/NautilusPython

http://bazaar.launchpad.net/~costales/folder-color/trunk/view/head:/nautilus-extension/folder-color.py

Marking multiple files

http://askubuntu.com/questions/186509/how-do-i-make-a-custom-right-click-command-for-nautilus

SunyataZero commented 8 years ago

Issues for the clamtk project

36

https://github.com/dave-theunsub/clamtk/issues/36

What about giving the user a warning and confirm button before removing all? Something like this:

You are about to remove more than one virus at the same time. Please consider carefully before proceeding since ___

SunyataZero commented 8 years ago

Other notes

Where to store python files so that they are read by nautilus

nautilus-python extensions can be stored here ~/.local/share/nautilus-python/extensions or here /usr/share/nautilus-python/extensions/clamtk.py

These can be ignored

This command line text output (shown when running nautilus from the command line) can be ignored because it is seen even when our code is not running:

sunyata@sunyata-Aspire-ES1-131:/usr/share/nautilus-python/extensions$ nautilus

(nautilus:4382): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

sys:1: PyGIWarning: Nautilus was imported without specifying a version first. Use gi.require_version('Nautilus', '3.0') before import to ensure that the right version gets loaded.

Initializing nautilus-dropbox 2015.10.28

** (nautilus:4382): CRITICAL **: nautilus_menu_provider_get_background_items: assertion 'NAUTILUS_IS_MENU_PROVIDER (provider)' failed
SunyataZero commented 8 years ago

clamtk-gnome without running GNOME?

I managed to run clamtk-gnome without having installed the python-gobject .deb package on my Lubuntu distro with LXDE

SunyataZero commented 8 years ago

Translation tutorial

http://inventwithpython.com/blog/2014/12/20/translate-your-python-3-program-with-the-gettext-module/

gettext ref: https://docs.python.org/2/library/gettext.html

Changes from what's suggested in the tutorial

String formatting _for Python 2_:

To make sure that when a string is translated whith the good characters, I format my string like this: print(_(u"My_string")) To encode it in utf-8 (to have accent in some languages like french or spanish).

Other alternatives: http://stackoverflow.com/questions/14682933/chinese-and-japanese-character-support-in-python

Running pygettext:

/usr/bin/pygettext -d clamtk clamtk.py

Poedit is in the Ubuntu repo

...so we don't need to download the source from the website that is linked to in the tutorial

Translations in Launchpad

https://help.launchpad.net/Translations/YourProject

gettext on ubuntu

https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/InternationalizationPrimer/Gettext

SunyataZero commented 8 years ago

Debian packages: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html

SunyataZero commented 8 years ago

sunyata@sunyata-Aspire-ES1-131:~$ locate clamtk.py /home/sunyata/PycharmProjects/clamtk-gnome/clamtk.py /home/sunyata/PycharmProjects/clamtk-gnome/clamtk.py.bak /usr/share/nautilus-python/extensions/clamtk.py sunyata@sunyata-Aspire-ES1-131:~$

sunyata@sunyata-Aspire-ES1-131:/usr/share/locale/sv/LC_MESSAGES$ ll clamtk* -rw-r--r-- 1 root root 12942 okt 24 2015 clamtk.mo sunyata@sunyata-Aspire-ES1-131:/usr/share/locale/sv/LC_MESSAGES$

SunyataZero commented 8 years ago

https://wiki.debian.org/Packaging https://www.debian.org/doc/manuals/maint-guide/ https://wiki.debian.org/HowToPackageForDebian https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.en.pdf

SunyataZero commented 8 years ago

About desktop files: https://specifications.freedesktop.org/desktop-entry-spec/latest/

SunyataZero commented 8 years ago

Doc updates

To restart

killall nautilus

SunyataZero commented 8 years ago
SunyataZero commented 8 years ago

clamtk bug: command line clamtk only accepts a full path for the directories, ex: sunyata@sunyata-Aspire-ES1-131:~/PycharmProjects/clamtk-gnome$ clamtk /home/sunyata/Pictures/

SunyataZero commented 8 years ago

https://github.com/GNOME/nautilus/blob/master/src/nautilus-vfs-file.h