wiki:TracQuery

Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, which can be used to display tickets that meet specified criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.

Filters

When you first go to the query page, the default filter will display tickets relevant to you:

  • If logged in then all open tickets, it will display open tickets assigned to you.
  • If not logged in but you have specified a name or email address in the preferences, then it will display all open tickets where your email (or name if email not defined) is in the CC list.
  • If not logged in and no name/email is defined in the preferences, then all open issues are displayed.

Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the dropdown lists at the bottom corners of the filters box; 'And' conditions on the left, 'Or' conditions on the right. Filters with either a text box or a dropdown menu of options can be added multiple times to perform an Or on the criteria.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

After you have edited your filters, click the Update button to refresh your results.

Keyboard shortcuts are available for manipulating the checkbox filters:

  • Clicking on a filter row label toggles all checkboxes.
  • Pressing the modifier key while clicking on a filter row label inverts the state of all checkboxes.
  • Pressing the modifier key while clicking on a checkbox selects the checkbox and deselects all other checkboxes in the filter.

The modifier key is platform and browser dependent. On Mac the modified key is Option/Alt or Command. On Linux the modifier key is Ctrl + Alt. Opera on Windows seems to use Ctrl + Alt, while Alt is effective for other Windows browsers.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria , the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.

Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.

Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria, see Query Language.

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field>. You can specify multiple fields and what order they are displayed in by placing pipes (|) between the columns:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Results (1 - 3 of 2804)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#3870 fixed add missing depencencies into winGRASS grass-dev@… hellik
#3867 fixed menudata.py: global name 'error_handler' is not defined wenzeslaus marisn
#3865 fixed i.spec.unmix: map writeout broken grass-dev@… neteler
1 2 3 4 5 6 7 8 9 10 11

Full rows

In table format you can also have full rows by using rows=<field>:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 2804)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#3870 fixed add missing depencencies into winGRASS grass-dev@… hellik
Description

see

https://lists.osgeo.org/pipermail/grass-dev/2019-July/092916.html

>> [1]
>> https://github.com/OSGeo/grass/blob/master/mswindows/osgeo4w/package.sh#L260
> 
> ok
> 
> there is libharfbuzz-0.dll in the list; see
> 
> https://github.com/msys2/MINGW-packages/issues/1322
> 
> /A new version of harfbuzz is requires -lgraphite2 but graphite2 mingw
> package dont have libgraphite2.a./
> 
> so it seems it's a dependency problem with the new dependencies.

yes it is a dependency problem with the new dependencies. :-)

looking deeper

wingrass at DESKTOP-VADT8Q4 MSYS ~
$ pacman -Ss graphite
mingw32/mingw-w64-i686-graphite2 1.3.13-1
    Font rendering capabilities for complex non-Roman writing systems
    (mingw-w64)
mingw64/mingw-w64-x86_64-graphite2 1.3.13-1 [installed]
    Font rendering capabilities for complex non-Roman writing systems
    (mingw-w64)

C:\msys64\mingw64\bin\libgraphite2.dll


wingrass at DESKTOP-VADT8Q4 MSYS ~
$ pacman -Ss pcre
mingw32/mingw-w64-i686-pcre 8.43-1
    A library that implements Perl 5-style regular expressions (mingw-w64)
mingw32/mingw-w64-i686-pcre2 10.33-1
    A library that implements Perl 5-style regular expressions (mingw-w64)
mingw32/mingw-w64-i686-re2 20190701-1
    A fast, safe, thread-friendly alternative to backtracking regular
expression engines like those used in PCRE, Perl, and Python (mingw-w64)
mingw64/mingw-w64-x86_64-pcre 8.43-1 [installed]
    A library that implements Perl 5-style regular expressions (mingw-w64)
mingw64/mingw-w64-x86_64-pcre2 10.33-1
    A library that implements Perl 5-style regular expressions (mingw-w64)
mingw64/mingw-w64-x86_64-re2 20190701-1
    A fast, safe, thread-friendly alternative to backtracking regular
expression engines like those used in PCRE, Perl, and Python (mingw-w64)
msys/libpcre 8.43-2 (libraries) [installed]
    A library that implements Perl 5-style regular expressions
msys/libpcre16 8.43-2 (libraries) [installed]
    A library that implements Perl 5-style regular expressions
msys/libpcre2_16 10.33-2 (libraries)
    A library that implements Perl 5-style regular expressions
msys/libpcre2_32 10.33-2 (libraries)
    A library that implements Perl 5-style regular expressions
msys/libpcre2_8 10.33-2 (libraries) [installed]
    A library that implements Perl 5-style regular expressions
msys/libpcre2posix 10.33-2 (libraries)
    A library that implements Perl 5-style regular expressions
msys/libpcre32 8.43-2 (libraries) [installed]
    A library that implements Perl 5-style regular expressions
msys/libpcrecpp 8.43-2 (libraries) [installed]
    A library that implements Perl 5-style regular expressions
msys/libpcreposix 8.43-2 (libraries) [installed]
    A library that implements Perl 5-style regular expressions
msys/pcre 8.43-2 [installed]
    A library that implements Perl 5-style regular expressions
msys/pcre-devel 8.43-2 (development)
    PCRE headers and libraries
msys/pcre2 10.33-2
    A library that implements Perl 5-style regular expressions
msys/pcre2-devel 10.33-2 (development)
    PCRE headers and libraries

C:\msys64\mingw64\bin\libpcre-1.dll

both missing dlls are in my msys2 build environment;

copying these into C:\OSGeo4W64\apps\grass\grass77\bin solves the problem.

will open a ticket and hopefully my first PR :-)

missing dlls libgraphite2.dll and libpcre-1.dll have to be added to winGRASS.

#3867 fixed menudata.py: global name 'error_handler' is not defined wenzeslaus marisn
Description

Some imports missing? Tested with f79c3568d69f2d706b9c9383a0a3e188d2137b0b

File "/home/maris/soft/grass-main/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py", line 172, in <module>
    sys.exit(main())
  File "/home/maris/soft/grass-main/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py", line 159, in main
    app = GMApp(workspaceFile)
  File "/home/maris/soft/grass-main/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py", line 53, in __init__
    wx.App.__init__(self, False)
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 8628, in __init__
    self._BootstrapApp()
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 8196, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/home/maris/soft/grass-main/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py", line 106, in OnInit
    workspace=self.workspaceFile)
  File "/home/maris/soft/grass-main/dist.x86_64-pc-linux-gnu/gui/wxpython/lmgr/frame.py", line 131, in __init__
    self._moduleTreeBuilder = LayerManagerModuleTree(message_handler=add_menu_error)
  File "/home/maris/soft/grass-main/dist.x86_64-pc-linux-gnu/gui/wxpython/lmgr/menudata.py", line 70, in __init__
    error_handler(_("Unable to parse user toolboxes XML files. "
NameError: global name 'error_handler' is not defined
#3865 fixed i.spec.unmix: map writeout broken grass-dev@… neteler
Description

For unknow reasons i.spec.unmix is unable to write out the resulting maps:

GRASS 7.7.dev (nc_spm_08_grass7):~ >

g.region raster=lsat7_2002_10 -p
[...]
nsres:      28.5
ewres:      28.5
rows:       475
cols:       527
cells:      250325

i.spec.unmix group=lsat_2002 matrix=spectrum.txt result=lsat7_2002_unmix   error=lsat7_2002_unmix_err iter=lsat7_2002_unmix_iterations
D0/0: buff: Matrix:	5 by 7
Opening input file no. 1 [lsat7_2002_10]
Opening input file no. 2 [lsat7_2002_20]
Opening input file no. 3 [lsat7_2002_30]
Opening input file no. 4 [lsat7_2002_40]
Opening input file no. 5 [lsat7_2002_50]
Opening input file no. 6 [lsat7_2002_70]
Opening input file no. 7 [lsat7_2002_80]
Opening output file [lsat7_2002_unmix.1]
Opening output file [lsat7_2002_unmix.2]
Opening output file [lsat7_2002_unmix.3]
Opening output file [lsat7_2002_unmix.4]
Opening output file [lsat7_2002_unmix.5]
Opening error file [lsat7_2002_unmix_err]
Opening iteration file [lsat7_2002_unmix_iterations]
Checking linear dependencies (orthogonality check) of Matrix A...
Angle between row 1 and row 2: 60.9753 degree
Angle between row 1 and row 3: 56.5953 degree
Angle between row 1 and row 4: 34.7591 degree
Angle between row 1 and row 5: 43.122 degree
Angle between row 2 and row 1: 60.9753 degree
Angle between row 2 and row 3: 42.7788 degree
Angle between row 2 and row 4: 35.7377 degree
Angle between row 2 and row 5: 40.2744 degree
Angle between row 3 and row 1: 56.5953 degree
Angle between row 3 and row 2: 42.7788 degree
Angle between row 3 and row 4: 32.3279 degree
Angle between row 3 and row 5: 28.9019 degree
Angle between row 4 and row 1: 34.7591 degree
Angle between row 4 and row 2: 35.7377 degree
Angle between row 4 and row 3: 32.3279 degree
Angle between row 4 and row 5: 28.552 degree
Angle between row 5 and row 1: 43.122 degree
Angle between row 5 and row 2: 40.2744 degree
Angle between row 5 and row 3: 28.9019 degree
Angle between row 5 and row 4: 28.552 degree
Spectral matrix is o.k. Proceeding...
Calculating for 475 x 527 pixels (7 bands) = 277729 pixelvectors.
 100%
ERROR: Unable to open header file for raster map
       <lsat7_2002_unmix.1@PERMANENT>

Since i.spec.unmix was ported from GRASS 5 years ago, perhaps some raster function usage is not correct?

I have attached the input matrix of endmembers for easy testing.

Ideas welcome!

1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Filters are separated by ampersands (&). Each filter consists of the ticket field name, an operator and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values. To include a literal & or | in a value, escape the character with a backslash (\).

The available operators are:

= the field content exactly matches one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be omitted to avoid having to quote the query string.

created=2007-01-01..2008-01-01 query tickets created in 2007
created=lastmonth..thismonth query tickets created during the previous month
modified=1weekago.. query tickets that have been modified in the last week
modified=..30daysago query tickets that have been inactive for the last 30 days

See also: TracTickets, TracReports, TracGuide, TicketQuery

Last modified 2 years ago Last modified on Feb 1, 2017 12:36:53 AM