-
Notifications
You must be signed in to change notification settings - Fork 5
CONTRIBUTING
See README #manual
- our coding style is loosly based on PEP 8
- 4 spaces for indentation is the must
- try to fit each line with in 80 columns margin
- if your indent more than 5 level, something not right
We encourage move beyond the PEP 8 and code more pythonic and human readable form.
Beyond the prerequisite mentioned above, several tools available for assisting the development of GNOME application.
DevHelp: An API documentation browser for GNOME
Glade: A GUI designer for GTK+ Applications
A good text-editor or IDE (Integrated Development Environment)
There are mainly 3 branches,
Branch | Description |
---|---|
master | stable working version |
dev | version for power users |
experimental | version for hackers/developer |
Start with dev
branch to begin development, master
branch is
usually stable branch for common users.
If you want to be upto date with latest development use
experimental
which might be really 🔥 unstable 🔥.
anubad/ ├── CONTRIBUTING.org # this file ├── Makefile.am # for gnome-style build ├── autogen.sh # for gnome-style build ├── configure.ac # for gnome-style build ├── default.ini # default configuration file ├── demo.pyw # legacy version of anubad : ├── assets/ # icons ├── help/ # help files ├── plugins/ # default plugin folder │ ├── espeak.py │ : │ └── number2word.py ├── ... : └── src/ # source code ├── core.py ├── main.py : ├── Makefile # lists runnable recipies └── ui ├── home.py # home ui component ├── home.css # css file for home.py : └── Makefile # lists runnable recipies
file naming convention in repository
Pattern | Description |
---|---|
plugins/*.{c,py} | plugin codes |
src/*.{c,py} | anubad source codes |
src/ui/_*.css | css file for Window with same name |
src/ui/_*.py | widgets componets of Window |
Every python file should be executed separately
- Try to include relative functionality in one place
- Don’t littering your code
- Include doctest if possible
- it would be nice to have unit test
- class names:
- CamelCase, and capitalize acronyms: HTTPWriter, not HttpWriter.
- always name a method’s first argument self
- always name
@classmethod
first argument cls - always use *args and **kwargs for variable argument lists
- variables
- normally lower_with_underscores
- Injected variable name should be in UPPER CASE
- declarative path variable should start with
PATH_
prefix - declarative file variable should start with
FILE_
prefix - precompiled regular expressions
re_
prefix
- function
-
function name should be
lower_with_underscores
- prefix underscore ‘_’ to nested function name
- no. of underscore ‘_’ represent nested levels
- encapsulate(nested) function when its trival and tiny
-
function name should be
- modules
- lower_with_underscores.py. (But, prefer names that don’t need underscores!)
There are various keyword used inside comment, these are what they mean.
Keyword | Meaning |
---|---|
FIXME | things that could be fixed but i’m lazy |
TODO | new task or feature/idea not done yet |
BUG | known annoying bug, which may/may not be fixable |
TIP | just a friendly NOTE |
TESTING | thing that are not yet ready |
WARN | STOP IT, have been then, you don’t want to |
NOTE | something important, you should know |
Reference:
- https://developer.gnome.org/gtk3/stable/chap-css-overview.html
- https://gist.github.com/ptomato/0fb634ef4098bb89026f
Running the ./autogen.sh
creates the following files:
- aclocal.m4
- autom4te.cache
- config.log
- config.status
- configure
- anubad.desktop
- install-sh
- missing
- Makefile.in
- Makefile
Running make install
, installs the application in /usr/local/bin
and installs the anubad.desktop file in
/usr/local/share/applications
You can now run the application by typing “anubad” in the Overview.
To uninstall, type:
$ make uninstall
$ make distcheck
This will create hello-world-1.0.tar.xz
https://guides.github.com/features/issues/
searching algorithm and library
level | Description |
---|---|
0 | exact match, binary search |
1 | distance map, traverse search |
2 | similarity search |
3 | relation search |
each entries withough
“cro*p” → crop, crop up, croup, crock up, crow step
“*chester” → chester, manchester, rochester, winchester and toy manchester
“can????r” → canister and cannular
“andre*[x|y|z]” → andre malraux, andrei tarkovsky, andres, martinez, etc.
“a[c|d|e]{2,}” → acc, accede, ace, add, ade and aec.
Suggestions is a feature that gives out possible near matches when a misspelled word is searched for. To have this feature, your system should have libenchant binary (libenchant.so.1) installed and an English dict file for the spell engine to refer (locale doesn’t matter).
by default we have few supporting plugins espeak
and
number2word
.
basic configuration looks like this
[plugin "sajha"] name = sajha path = /mnt/Core/कामकाज/foss-np/anubad/plugins/ version = 0.1 priority = 9 disable = False
Attributes | Description |
---|---|
name | |
path | |
version | strictly numeric values only |
priority | lowest number gets high priority i.e 0-9 |
platforms |
User can selects some text in any window, and presses shortcut-combo, without need to copy paste it.
add examples via plugin/online dictionary/wordnet
Should the user prefer passive desktop notifications (balloon tips), rather than the application popping up with the definitions, it can be done by enabling Notifications. This is done via the Notify tool button or by right-clicking on anubad’s system tray icon, and tick off the ‘Notifications’ check box in the menu. When notifications are enabled, and the user selects text in a window and presses the hotkey combo, anubad takes the prime definition of that term from
notify library’s binary (libnotify.so.1) should be available on your system. Also the notification-daemon should installed for the notifications to show up.
anubad han mulitlpe mode which are also extended via plugins.
For relatives like Antonyms, Pertainyms, Hypernyms, Hyponyms, Holonyms and Meronyms, where more than one level of relatives may be present, is showed in a tree fashion, in detailed mode. If in simple mode, only one level of relatives are shown even when more levels are present.
E.g. ‘rich’ has ‘poor’ and ‘lean’ alone as antonyms in simple mode. While in detailed mode, ‘poor’ further infers broke, skint, etc. which are shown as children of ‘poor’.
Regular expressions can be used to search for a term when you vaguely know it and want to locate it in the thesaurus. anubad’s regular expression pattern closely follows Wildmat syntax by Rich Salz owing to its simplicity.
- (wildcard) matches any number of (including 0) unknown characters
? (joker) matches one unknown character
[…] (range) matches one unknown character within the range specified
{m, n} (limits) upper & lower limits of the number of characters in a range
[^…] (not in the range) matches one unknown character NOT within the range specified
Look-ups made in anubad are stored as a per-user setting, and can be saved via the popup menu of the search bar or can be cleared too. Other options like showing term familiarity based on polysemy count, display of status icon, etc. can be changed via the Options window.
anubad is divided into small module
Portable, one file python 2 and 3 compatibility without extra dependencies.
This is design was more focused on making the code run with various platforms including
in python tkinter which is no longer in development due font rendering issues, and poor system intergation
/path/to/anubad/demo.pyw
plugin must have the function
plugin_main
to be plugin.
new plugins should be added to.
~/.cache/anubad/plugins/
variables | desc |
---|---|
__authors__ | list of authors separated by commas |
__support__ | support contact for plugins |
__version__ | numeric version only |
__depends__ | other dependencies of plugins |
__platform__ | value to be matched with os.name |
__docs__ | documentation of the plugins |
assortment developer friendly interface-engines.
Modes | Search prefix |
---|---|
Dump mode | ‘d:’ |
Command Line Access | ’$’ |
Internal Command Mode | ‘>’ |