Commit graph

421 commits

Author SHA1 Message Date
Adam Waldenberg
772cef01d4 Added support for gravatars to the responsibilities module.
In the process, also took the opportunity to improve the HTML output a bit.
2013-07-25 14:32:57 +02:00
Adam Waldenberg
e200fa42f9 Added some missing spaces to the Chinese translation.
There was a mistake at the top of the translation to the help text.
2013-07-25 11:37:02 +02:00
Adam Waldenberg
6b4de5d676 Updated the locales to work with the previously updated error string. 2013-07-25 09:21:23 +02:00
Chris Ring
92ef11fa20 Fix typo in error message.
The error message when using an incompatible version of
Python contains a typo.

Signed-off-by: Chris Ring <chris@ringthis.com>
Reviewed-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
2013-07-25 09:03:03 +02:00
Adam Waldenberg
66b63a6f0e The "-m" flag was being mistaken as "--checkout-missing".
This was because of the use of the "in" operator during processing of the
incoming options and arguments.
2013-07-24 09:06:30 +02:00
Adam Waldenberg
3ed1cf3618 Added the ability to specify size when fetching a gravatar URL. 2013-07-24 08:26:40 +02:00
Adam Waldenberg
329bb45947 Removed a dangling space character in the Chinese translation. 2013-07-23 01:19:37 +02:00
Adam Waldenberg
c69bd515c2 Did some minor tweaks to the strings inside the terminal module. 2013-07-23 01:09:20 +02:00
Adam Waldenberg
9b5e82bc2c Terminal can now fall back to default size under Windows (Fixes issue 12).
Previously; the __get_size_windows__() function could return "None",
whenever the terminal size couldn't be determined; something which broke
the execution.

There was some chance for misbehavior under Linux as well.
2013-07-23 01:08:53 +02:00
Adam Waldenberg
c5aba56928 HTMLEmbedded output was broken in the changes module. 2013-07-22 15:32:26 +02:00
Adam Waldenberg
d513ba530d HTMLEmbedded output was broken in the blame module. 2013-07-22 15:30:10 +02:00
Adam Waldenberg
863d5edce4 Fixed some minor annoyances in the Swedish .po file. 2013-07-22 06:38:18 +02:00
Bill Wang
13cb15f952 Added Chinese translation (Fixes issue 11). 2013-07-22 06:22:35 +02:00
Adam Waldenberg
8e22f0d2ca Fixed broken text output in the changes module. 2013-07-22 05:57:04 +02:00
Adam Waldenberg
662cd3fa63 Fixed some behavior that got broken with the implementation of gravatars.
Previously, gitinspector always tried to merge authors with the same name
(independently of the email). This behavior tends to (for the most part)
help in projects missing a .mailmap file. Often; authors commit under the
same name, but with different emails on different computers (if they for
example have a work email on their office desktop).

Whenever different e-mail addresses are used by an author; gitinspector
will use the last email it finds and will generate a gravatar from that
email address. This behavior was chosen because authors mostly do not tend
to create a gravatar image for their old email accounts (but often have
one in their newer ones).
2013-07-22 05:51:56 +02:00
Adam Waldenberg
35852f9859 Added support for gravatars in the changes, blame and timeline modules.
References to gravatar images are generated with HTML and XML outputs only
as these are the only formats where referencing gravatars makes sense
right now. The HTMLEmbedded format, for example, does not link to any
gravatars as that format prohibits the use of external links.

To accommodate the new images; the width of the generated HTML page has
been slightly increased. However, the HTML page should still fit on a
1280 display.
2013-07-20 11:45:11 +02:00
Adam Waldenberg
d07da3dc69 Bumped the version number to 0.3.0. 2013-07-15 05:33:23 +02:00
Adam Waldenberg
c91b8cc704 Output is now written to stderr when an exception is caught. 2013-07-15 04:48:25 +02:00
Adam Waldenberg
ed9bf56eb1 Generated debian package no longer has the python prefix in it's name.
Python packages that are applications and not strictly a package of
module(s) should be named <application>_<ver>_<arch>.deb.
2013-07-15 04:24:11 +02:00
Adam Waldenberg
95046a3a02 Unit tests are now excluded from binary packages. 2013-07-15 03:36:48 +02:00
Adam Waldenberg
1e43e47f4d Updated (and generated) locale files. 2013-07-15 03:22:07 +02:00
Adam Waldenberg
064a2e11b8 Added InvalidRegExpError in the filtering module.
This is a better solution than simply relying on ValueError and also
helps us to maintain compatibility with all our other exceptions (it gives
us a msg attribute that we can access when catching the error).

Also localized the string for InvalidRegExpError.
2013-07-14 12:19:31 +02:00
Adam Waldenberg
291761e6a4 Exceptions now store messages in self.msg directly.
Previously, they had a msg() method for fetching the error string. This
has now been removed in favor of the directly callable attribute.
2013-07-14 04:57:32 +02:00
Adam Waldenberg
cf63af8819 Fixed some pylint violations in some newly added code. 2013-07-14 04:47:34 +02:00
Adam Waldenberg
adf6ee412f -x and --exclude options now clear the filtering rules when first found.
This behavior is preferred in order for us to be able to override any
exclude filter set via git-config.
2013-07-14 04:29:00 +02:00
Adam Waldenberg
3a34be0d06 Added missing "--checkout-missing" long option to gitinspector module. 2013-07-14 04:15:41 +02:00
Adam Waldenberg
4fbcb48127 Rewrote git-config support once again.
It was still presuming that we were using optparse.
2013-07-14 04:15:10 +02:00
Adam Waldenberg
b28d86d1f2 Fixed a long-standing bug with exceptions not being able to handle unicode.
This was fixed by storing the exception string manually inside each
exception class. The error message is now stored in exception.msg instead
of relying on __str__(). It seems the normal behavior (by printing exceptions
directly) is broken in Python 2. It *does* work in Python 3, but this is
because it always handles everything as unicode.
2013-07-14 03:15:14 +02:00
Adam Waldenberg
5c9335088a Command-line arguments are now always converted to UTF-8 before use. 2013-07-14 03:10:00 +02:00
Adam Waldenberg
7f0e2b6fe8 Changed the argument parsing back to using getopt!
The support for optional boolean arguments is the same; but uses
getopt instead of optparse.

The whole adventure with optparse was a giant waste of time and just
forced us to monkey-patch optparse with some very ugly solutions in order
to make it do what we wanted; thus it was better to switch back to the
more low-level getopt module.

To accomplish this; a optval.gnu_getopt() function was added that is a
duplicate of the original getopt.gnu_getopt function but with support for
optional arguments.

A long option which accepts an optional argument is denoted with
arg:default_value in the long_options string.

In the end, this solution feels much better than the one with optparse.
2013-07-14 00:07:36 +02:00
Adam Waldenberg
cae99cb3f7 Extended the README with some "quick start" notes. 2013-07-12 03:50:21 +02:00
Adam Waldenberg
c073e32dbe Hacked optparse (yet again) to force it to play nice with unicode flags.
Previously, whenever a flag had unicode characters in it; it would all
completely blow up.
2013-07-12 03:36:03 +02:00
Adam Waldenberg
f4b10ce15f Moved unicode function declaration to a compatibility module.
This is used (as the name suggests) for compatibility between Python 2 and
Python 3.
2013-07-12 03:33:13 +02:00
Adam Waldenberg
8edd72a609 gitinspector now exits if it fails to change directory to the repo root. 2013-07-10 16:58:06 +02:00
Adam Waldenberg
84bb7bed2d Removed a pylint violation in the localization module. 2013-07-10 16:45:46 +02:00
Adam Waldenberg
aeb55c5a3e Fixed a potential encoding issue when printing exception messages. 2013-07-10 16:45:12 +02:00
Adam Waldenberg
2df9a31b60 gitinspector now finds the absolute path of the git directory.
If gitinspector was not executed standing in the root directory of the
git repository (or with a git root specified at the command line),
"git ls-tree" would not find all files properly.
2013-07-10 14:23:11 +02:00
Adam Waldenberg
9e39bf8ed2 Added the new localization strings to the pot file.
In the process, the new strings were also translated to Swedish. To
properly handle localized string constants, a new function "N_()" was
added which can be supplied to xgettext when collecting strings.
2013-07-10 13:55:23 +02:00
Adam Waldenberg
ccd995a02b Improved localization in the optval module. 2013-07-10 05:25:57 +02:00
Adam Waldenberg
3b82acdfa1 Added a --localize-output flag.
The default behaviour is now not to localize the output, only the help
text and error messages (all the user interaction).

The way localized messages are fetched in the modules has been modified
as well; to allow for the ability to enable and disable the localization.
2013-07-10 05:24:18 +02:00
Adam Waldenberg
109fefb978 Fixed some small mistakes in relation to handling of git-config settings. 2013-07-10 03:32:29 +02:00
Adam Waldenberg
a05403df60 Added localization support to optparse error messages.
The optparse module does not seem to support this by default. The solution
is not very pretty, but it works.
2013-07-10 03:11:15 +02:00
Adam Waldenberg
0d2bf9b0a8 Implemented optional boolean arguments to some command-line options.
Just like in many GNU tools, it is now possible to pass an optional
boolean to some of the flags of gitinspector in the form;

--flag[=BOOL]

This gives us the ability to override options set via git-config.
For example; say we did the following:

git-config --global inspector.timeline true

We could then override this setting when running gitinspector by supplying:

./gitinspector.py --timeline=false

Implementing this was not a trivial task, as no command-line parser in
Python supports this by default (getopt, optparse, argparse). In order to
properly handle optional boolean arguments; some clever patching had to
be done to the command-line in combination with a callback function that
can handle boolean strings. To maintain compatibility with Python 2.6,
this was implemented using optparse (instead of argparse).
2013-07-09 12:40:59 +02:00
Adam Waldenberg
663493fd41 Localization module is now initialized only once (instead of twice).
This removes an unnecessary initialization and also fixes the behavior
under Windows which was broken because of the second initialization.
2013-07-04 10:55:54 +02:00
Adam Waldenberg
7bc297e99f Added two unit tests for testing the comment module. 2013-07-04 10:10:11 +02:00
Adam Waldenberg
942836cc1c There was a mixup in the metrics module (wrong ordering of return values). 2013-07-04 10:07:41 +02:00
Adam Waldenberg
bb72cc8f02 Added a handle_comment_block() function in the comment module.
This function moves most of the logic of handling comments into the
comment module itself, thus avoiding duplicated code and allowing for
a cleaner solution.
2013-07-02 23:03:09 +02:00
Adam Waldenberg
f20b826d2d Added long option (--weeks) to the -w option.
This makes it clearer that it is supported in conjunction with git-config
as well.
2013-07-02 07:45:56 +02:00
Adam Waldenberg
15026f6f00 Translation files are now included during packaging via setup.py. 2013-07-02 07:35:40 +02:00
Adam Waldenberg
017f63e98a The translation files are now found regardless of the current directory.
It was previously only working if gitinspector was executed from the base
directory.
2013-07-02 07:33:46 +02:00