[devtools] make PostgresTestDataBaseHandler start its own postgresql
Don't depend on postgresql already running on the system, or on a static
config.
To use this, set the configcls attribute of your CubicWebTC-derived test
class to PostgresApptestConfiguration.
Caveats:
- this won't work with several tests running concurrently from the
same directory, since each would start its own cluster with a shared
data directory and stomp on each other's toes
- you need initdb/pg_ctl in $PATH, e.g /usr/lib/postgresql/$version/bin
on Debian/Ubuntu systems.
Closes #3489631
try:rtype,=__args__exceptValueError:print'USAGE: cubicweb-ctl shell <instance> detect_cycle.py -- <relation type>'printgraph={}forfromeid,toeidinrql('Any X,Y WHERE X %s Y'%rtype):graph.setdefault(fromeid,[]).append(toeid)fromlogilab.common.graphimportget_cyclesforcycleinget_cycles(graph):print'cycle','->'.join(str(n)fornincycle)