[GRASS-SVN] r32446 - grass/trunk/vector/v.in.dxf
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 1 09:35:00 EDT 2008
Author: martinl
Date: 2008-08-01 09:35:00 -0400 (Fri, 01 Aug 2008)
New Revision: 32446
Modified:
grass/trunk/vector/v.in.dxf/add_3dface.c
grass/trunk/vector/v.in.dxf/add_arc.c
grass/trunk/vector/v.in.dxf/add_circle.c
grass/trunk/vector/v.in.dxf/add_line.c
grass/trunk/vector/v.in.dxf/add_lwpolyline.c
grass/trunk/vector/v.in.dxf/add_point.c
grass/trunk/vector/v.in.dxf/add_polyline.c
grass/trunk/vector/v.in.dxf/add_text.c
grass/trunk/vector/v.in.dxf/global.h
grass/trunk/vector/v.in.dxf/layer_list.c
grass/trunk/vector/v.in.dxf/main.c
grass/trunk/vector/v.in.dxf/write_vect.c
Log:
v.in.dxf: message cleaning, -l flag: print also GRASS compliant name (used by wxGUI)
Modified: grass/trunk/vector/v.in.dxf/add_3dface.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_3dface.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_3dface.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -26,8 +26,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_arc.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_arc.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_arc.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -33,8 +33,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_circle.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_circle.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_circle.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -29,8 +29,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_line.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_line.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_line.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -25,8 +25,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_lwpolyline.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_lwpolyline.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_lwpolyline.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -29,8 +29,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_point.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_point.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_point.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -24,8 +24,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_polyline.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_polyline.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_polyline.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -72,8 +72,9 @@
if (polyline_flag & 8 || polyline_flag & 16 || polyline_flag & 17 ||
polyline_flag & 32)
if (warn_flag70) {
- G_warning(_("3-d data in dxf file. Polyline_flag: %d"),
- polyline_flag);
+ if (!flag_list)
+ G_warning(_("3-d data in dxf file. Polyline_flag: %d"),
+ polyline_flag);
warn_flag70 = 0;
}
break;
@@ -102,8 +103,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/add_text.c
===================================================================
--- grass/trunk/vector/v.in.dxf/add_text.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/add_text.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -32,8 +32,7 @@
if (flag_list) {
if (!is_layer_in_list(dxf_buf)) {
add_layer_to_list(dxf_buf);
- fprintf(stdout, _("Layer %d: %s\n"), num_layers,
- dxf_buf);
+ print_layer(dxf_buf);
}
return 0;
}
Modified: grass/trunk/vector/v.in.dxf/global.h
===================================================================
--- grass/trunk/vector/v.in.dxf/global.h 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/global.h 2008-08-01 13:35:00 UTC (rev 32446)
@@ -43,6 +43,7 @@
void add_layer_to_list(char *);
int is_layer_in_list(char *);
void init_list(void);
+void print_layer(const char*);
/* read_dxf.c */
struct dxf_file *dxf_open(char *);
Modified: grass/trunk/vector/v.in.dxf/layer_list.c
===================================================================
--- grass/trunk/vector/v.in.dxf/layer_list.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/layer_list.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -51,3 +51,22 @@
return;
}
+
+void print_layer(const char* layer_name)
+{
+ char *grass_name;
+
+ grass_name = G_store(layer_name);
+
+ G_str_to_lower(grass_name);
+ G_str_to_sql(grass_name);
+
+ fprintf(stdout, _("Layer %d: %s (%s)\n"), num_layers,
+ layer_name, grass_name);
+
+ fflush(stdout);
+
+ G_free((void *) grass_name);
+
+ return;
+}
Modified: grass/trunk/vector/v.in.dxf/main.c
===================================================================
--- grass/trunk/vector/v.in.dxf/main.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/main.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -121,6 +121,7 @@
num_layers = 0;
layers = NULL;
Map = NULL;
+ G_verbose_message(_("Layer number: layer name (GRASS compliant name)"));
}
else {
/* make vector map name SQL compliant */
Modified: grass/trunk/vector/v.in.dxf/write_vect.c
===================================================================
--- grass/trunk/vector/v.in.dxf/write_vect.c 2008-08-01 11:46:30 UTC (rev 32445)
+++ grass/trunk/vector/v.in.dxf/write_vect.c 2008-08-01 13:35:00 UTC (rev 32446)
@@ -55,7 +55,7 @@
db_set_string(&sql, buf);
if (db_execute_immediate(driver, &sql) != DB_OK)
- G_fatal_error(_("Cannot execute: %s"), db_get_string(&sql));
+ G_fatal_error(_("Unable to insert new record: %s"), db_get_string(&sql));
db_free_string(&sql);
}
else
@@ -182,7 +182,7 @@
db_start_driver_open_database(Fi[i]->driver,
Vect_subst_var(Fi[i]->database, Map));
if (!driver)
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Vect_subst_var(Fi[i]->database, Map), Fi[i]->driver);
db_begin_transaction(driver);
@@ -201,18 +201,20 @@
db_set_string(&sql, buf);
if (db_execute_immediate(driver, &sql) != DB_OK)
- G_fatal_error(_("Cannot create table: %s"), db_get_string(&sql));
+ G_fatal_error(_("Unable to create table: %s"), db_get_string(&sql));
db_free_string(&sql);
if (db_grant_on_table
(driver, Fi[i]->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC) != DB_OK)
- G_fatal_error(_("Cannot grant privileges on table %s"), Fi[i]->table);
+ G_fatal_error(_("Unable to grant privileges on table <%s>"), Fi[i]->table);
if (db_create_index2(driver, Fi[i]->table, Fi[i]->key) != DB_OK)
- G_warning(_("Cannot create index"));
+ G_warning(_("Unable to create index for table <%s>, key <%s>"),
+ Fi[i]->table, Fi[i]->key);
if (Vect_map_add_dblink(Map, *field, field_name, Fi[i]->table, "cat",
Fi[i]->database, Fi[i]->driver))
- G_warning(_("Cannot link table: %s"), Fi[i]->table);
+ G_warning(_("Unable to add database link for vector map <%s>"),
+ Vect_get_full_name(Map));
return i;
}
More information about the grass-commit
mailing list