[Fwd: broken db.dropcolumn in grass_trunk?]

2 messages Options
Embed this post
Permalink
Nikos Alexandris

[Fwd: broken db.dropcolumn in grass_trunk?]

Reply Threaded More More options
Print post
Permalink
(
did the forwarded message reach the grass-dev list?
)

Currently "db.dropcolumn" in "grass_trunk/scripts/db.dropcolumn"
complains:

-%<--
Traceback (most recent call last):
  File
"/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/scripts/db.dropcolumn", line 117, in <module>
    main()
  File
"/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/scripts/db.dropcolumn", line 72, in main
    cols = [f[0] for f in grass.db_describe()['cols']]
TypeError: db_describe() takes exactly 1 argument (0 given)
-%<--

Shouldn't the "grass.db_describe()" [2] command fed with an argument
(e.g. the "table" string [1])? Not sure though since I am very beginner
with Python.

Nikos

---
[1] cat -n db.dropcolumn.py | grep 'table = options'
54    table = options['table']

[2] cat -n db.dropcolumn.py | grep grass.db_describe
    72    cols = [f[0] for f in grass.db_describe()['cols']]
    87 for f in grass.db_describe()['cols']:

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Martin Landa

Re: [Fwd: broken db.dropcolumn in grass_trunk?]

Reply Threaded More More options
Print post
Permalink
Hi,

2009/10/12 Nikos Alexandris <[hidden email]>:

> Traceback (most recent call last):
>  File
> "/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/scripts/db.dropcolumn", line 117, in <module>
>    main()
>  File
> "/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/scripts/db.dropcolumn", line 72, in main
>    cols = [f[0] for f in grass.db_describe()['cols']]
> TypeError: db_describe() takes exactly 1 argument (0 given)
> -%<--
>
> Shouldn't the "grass.db_describe()" [2] command fed with an argument
> (e.g. the "table" string [1])? Not sure though since I am very beginner
> with Python.

yes, see [1].

> [1] cat -n db.dropcolumn.py | grep 'table = options'
> 54          table = options['table']
>
> [2] cat -n db.dropcolumn.py | grep grass.db_describe
>    72      cols = [f[0] for f in grass.db_describe()['cols']]
>    87          for f in grass.db_describe()['cols']:

fixed in r39493 (untested).

Martin

[1] http://download.osgeo.org/grass/grass7_progman/namespacepython_1_1db.html#f874bd835539375c6123d648db203a74

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user