Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 08 Feb 2014 09:26:08 UTC
Commit: 3d9908df8cf63c857d2f38b6653df018acb67ba8
https://github.com/geany/geany/commit/3d9908df8cf63c857d2f38b6653df018acb67…
Log Message:
-----------
Set tag kind for Python imports to externvar and map them in the symbol list.
This fixes 'Go to Tag definition' for parsed Python imports as before the import
statement was chosen as the definition while we prefer the class definition as
target.
Modified Paths:
--------------
src/symbols.c
tagmanager/ctags/python.c
Modified: src/symbols.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -887,7 +887,7 @@ static void add_top_level_items(GeanyDocument *doc)
&(tv_iters.tag_member), _("Methods"), "classviewer-macro",
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
- &(tv_iters.tag_namespace), _("Imports"), "classviewer-namespace",
+ &(tv_iters.tag_externvar), _("Imports"), "classviewer-namespace",
NULL);
break;
}
Modified: tagmanager/ctags/python.c
4 files changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -33,7 +33,9 @@
{TRUE, 'f', "function", "functions"},
{TRUE, 'm', "method", "class methods"},
{TRUE, 'v', "variable", "variables"},
- {TRUE, 'i', "namespace", "imports"}
+ /* defined as externvar to get those excluded as forward type in symbols.c:goto_tag()
+ * so we can jump to the real implementation (if known) instead of to the import statement */
+ {TRUE, 'x', "externvar", "imports"}
};
typedef enum {
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 08 Feb 2014 09:23:30 UTC
Commit: c4b0f0f74dc370ee43a14f76af3f4ba9fab48139
https://github.com/geany/geany/commit/c4b0f0f74dc370ee43a14f76af3f4ba9fab48…
Log Message:
-----------
Add new symbol list category "Extern variables"
This is a requirement for an upcoming Python parser fix. This new category
will be currently only used by Python, C and D parsers. Before this change,
in C & D extern variables were sorted into the category "Other", now they
have their own category.
Modified Paths:
--------------
src/symbols.c
Modified: src/symbols.c
8 files changed, 8 insertions(+), 0 deletions(-)
===================================================================
@@ -528,6 +528,7 @@ struct TreeviewSymbols
GtkTreeIter tag_macro;
GtkTreeIter tag_member;
GtkTreeIter tag_variable;
+ GtkTreeIter tag_externvar;
GtkTreeIter tag_namespace;
GtkTreeIter tag_struct;
GtkTreeIter tag_interface;
@@ -545,6 +546,7 @@ static void init_tag_iters(void)
tv_iters.tag_member.stamp = -1;
tv_iters.tag_macro.stamp = -1;
tv_iters.tag_variable.stamp = -1;
+ tv_iters.tag_externvar.stamp = -1;
tv_iters.tag_namespace.stamp = -1;
tv_iters.tag_struct.stamp = -1;
tv_iters.tag_interface.stamp = -1;
@@ -1036,6 +1038,7 @@ static void add_top_level_items(GeanyDocument *doc)
}
tag_list_add_groups(tag_store,
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
+ &(tv_iters.tag_externvar), _("Extern Variables"), "classviewer-var",
&(tv_iters.tag_other), _("Other"), "classviewer-other", NULL);
}
}
@@ -1172,6 +1175,11 @@ static GtkTreeIter *get_tag_type_iter(TMTagType tag_type, filetype_id ft_id)
iter = &tv_iters.tag_function;
break;
}
+ case tm_tag_externvar_t:
+ {
+ iter = &tv_iters.tag_externvar;
+ break;
+ }
case tm_tag_macro_t:
case tm_tag_macro_with_arg_t:
{
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 01 Feb 2014 13:11:25 UTC
Commit: 39f13cb3b6a47e535a04385a0d2207bcec9fce87
https://github.com/geany/infrastructure/commit/39f13cb3b6a47e535a04385a0d22…
Log Message:
-----------
Send a specific user-agent to tiny.cc as they seem to block urllib's default
For some reason, tiny.cc started to block requests with the user-agent
"Python-urllib/2.7" which is the default of the urllib module.
Using any other user-agent works so we send our own including a link
to the script's source code.
Modified Paths:
--------------
scripts/git2irc/git2irc.py
Modified: scripts/git2irc/git2irc.py
8 files changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -46,7 +46,7 @@
from cgi import FieldStorage
from json import loads
-from urllib2 import urlopen
+from urllib2 import urlopen, Request
from urllib import urlencode
import logging
import logging.handlers
@@ -63,6 +63,9 @@
# extend on demand
LOG_EMAIL_ADDRESSES = ['enrico(a)geany.org']
+# user-agent to be used for requests to tiny.cc
+USER_AGENT = u'git2irc.py - https://raw.github.com/geany/infrastructure/master/scripts/git2irc/git2irc.…'
+
# global and cuts across concerns, assumed to be properly initialized later
logger = None # see init_logging()
config = {'git': {}, 'irc': {}, 'shortener': {}} # see init_config()
@@ -135,8 +138,9 @@ def shorten_url(long_url):
req_enc = urlencode(req)
req_url = '%s?%s' % (config['shortener']['url'], req_enc)
short_url = long_url # default is to return same URL (ie. in case of error)
+ request = Request(req_url, headers={"User-Agent": USER_AGENT})
try:
- resp_file = urlopen(req_url)
+ resp_file = urlopen(request)
resp_dict = loads(resp_file.read())
if int(resp_dict['errorCode']) == 0:
short_url = resp_dict['results']['short_url']
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).