ctioga2 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/Changelog +11 -0
  2. data/lib/ctioga2/commands/arguments.rb +1 -1
  3. data/lib/ctioga2/commands/commands.rb +1 -1
  4. data/lib/ctioga2/commands/doc/doc.rb +1 -1
  5. data/lib/ctioga2/commands/doc/documentation-commands.rb +1 -1
  6. data/lib/ctioga2/commands/doc/help.rb +1 -1
  7. data/lib/ctioga2/commands/doc/html.rb +1 -1
  8. data/lib/ctioga2/commands/doc/introspection.rb +1 -1
  9. data/lib/ctioga2/commands/doc/man.rb +1 -1
  10. data/lib/ctioga2/commands/doc/markup.rb +1 -1
  11. data/lib/ctioga2/commands/doc/wordwrap.rb +1 -1
  12. data/lib/ctioga2/commands/general-commands.rb +1 -1
  13. data/lib/ctioga2/commands/general-types.rb +1 -1
  14. data/lib/ctioga2/commands/groups.rb +1 -1
  15. data/lib/ctioga2/commands/interpreter.rb +8 -2
  16. data/lib/ctioga2/commands/parsers/command-line.rb +1 -1
  17. data/lib/ctioga2/commands/parsers/file.rb +4 -1
  18. data/lib/ctioga2/commands/strings.rb +1 -1
  19. data/lib/ctioga2/commands/type.rb +1 -1
  20. data/lib/ctioga2/commands/variables.rb +6 -6
  21. data/lib/ctioga2/data/backends/backend.rb +1 -1
  22. data/lib/ctioga2/data/backends/backends.rb +3 -2
  23. data/lib/ctioga2/data/backends/backends/direct.rb +72 -0
  24. data/lib/ctioga2/data/backends/backends/gnuplot.rb +1 -1
  25. data/lib/ctioga2/data/backends/backends/math.rb +1 -1
  26. data/lib/ctioga2/data/backends/backends/text.rb +8 -14
  27. data/lib/ctioga2/data/backends/description.rb +9 -5
  28. data/lib/ctioga2/data/backends/factory.rb +1 -1
  29. data/lib/ctioga2/data/backends/parameter.rb +1 -1
  30. data/lib/ctioga2/data/datacolumn.rb +1 -1
  31. data/lib/ctioga2/data/dataset.rb +50 -4
  32. data/lib/ctioga2/data/filters.rb +1 -1
  33. data/lib/ctioga2/data/indexed-dtable.rb +1 -1
  34. data/lib/ctioga2/data/point.rb +1 -1
  35. data/lib/ctioga2/data/stack.rb +151 -25
  36. data/lib/ctioga2/git-fools-svn.rb +7 -0
  37. data/lib/ctioga2/graphics/coordinates.rb +1 -1
  38. data/lib/ctioga2/graphics/elements.rb +1 -1
  39. data/lib/ctioga2/graphics/elements/containers.rb +1 -1
  40. data/lib/ctioga2/graphics/elements/contour.rb +5 -2
  41. data/lib/ctioga2/graphics/elements/curve2d.rb +1 -1
  42. data/lib/ctioga2/graphics/elements/element.rb +1 -1
  43. data/lib/ctioga2/graphics/elements/gradient-region.rb +1 -1
  44. data/lib/ctioga2/graphics/elements/parametric2d.rb +1 -2
  45. data/lib/ctioga2/graphics/elements/primitive.rb +1 -1
  46. data/lib/ctioga2/graphics/elements/redirecting-container.rb~ +123 -0
  47. data/lib/ctioga2/graphics/elements/region.rb +1 -1
  48. data/lib/ctioga2/graphics/elements/subplot.rb +1 -1
  49. data/lib/ctioga2/graphics/elements/tangent.rb +1 -1
  50. data/lib/ctioga2/graphics/elements/xyz-map.rb +1 -1
  51. data/lib/ctioga2/graphics/generator.rb +21 -4
  52. data/lib/ctioga2/graphics/legends.rb +1 -1
  53. data/lib/ctioga2/graphics/legends/area.rb +1 -1
  54. data/lib/ctioga2/graphics/legends/items.rb +1 -1
  55. data/lib/ctioga2/graphics/legends/provider.rb +1 -1
  56. data/lib/ctioga2/graphics/legends/storage.rb +1 -1
  57. data/lib/ctioga2/graphics/root.rb +1 -1
  58. data/lib/ctioga2/graphics/styles/axes.rb +2 -1
  59. data/lib/ctioga2/graphics/styles/background.rb +1 -1
  60. data/lib/ctioga2/graphics/styles/base.rb +1 -1
  61. data/lib/ctioga2/graphics/styles/carrays.rb +1 -1
  62. data/lib/ctioga2/graphics/styles/colormap.rb +1 -1
  63. data/lib/ctioga2/graphics/styles/curve.rb +1 -1
  64. data/lib/ctioga2/graphics/styles/drawable.rb +1 -1
  65. data/lib/ctioga2/graphics/styles/errorbar.rb +1 -1
  66. data/lib/ctioga2/graphics/styles/factory.rb +1 -1
  67. data/lib/ctioga2/graphics/styles/gradients.rb +1 -1
  68. data/lib/ctioga2/graphics/styles/legend.rb +1 -1
  69. data/lib/ctioga2/graphics/styles/location.rb +1 -1
  70. data/lib/ctioga2/graphics/styles/plot.rb +10 -1
  71. data/lib/ctioga2/graphics/styles/sets.rb +1 -1
  72. data/lib/ctioga2/graphics/styles/texts.rb +1 -1
  73. data/lib/ctioga2/graphics/subplot-commands.rb +1 -1
  74. data/lib/ctioga2/graphics/types.rb +1 -1
  75. data/lib/ctioga2/graphics/types/bijection.rb +1 -1
  76. data/lib/ctioga2/graphics/types/boundaries.rb +1 -1
  77. data/lib/ctioga2/graphics/types/boxes.rb +1 -1
  78. data/lib/ctioga2/graphics/types/dimensions.rb +1 -1
  79. data/lib/ctioga2/graphics/types/grid.rb +1 -1
  80. data/lib/ctioga2/graphics/types/location.rb +1 -1
  81. data/lib/ctioga2/graphics/types/point.rb +1 -1
  82. data/lib/ctioga2/log.rb +4 -1
  83. data/lib/ctioga2/metabuilder/type.rb +1 -1
  84. data/lib/ctioga2/metabuilder/types/coordinates.rb +1 -1
  85. data/lib/ctioga2/metabuilder/types/data.rb +1 -1
  86. data/lib/ctioga2/metabuilder/types/dates.rb +1 -1
  87. data/lib/ctioga2/metabuilder/types/generic.rb~ +225 -0
  88. data/lib/ctioga2/metabuilder/types/lists.rb +1 -1
  89. data/lib/ctioga2/metabuilder/types/numbers.rb +1 -1
  90. data/lib/ctioga2/metabuilder/types/strings.rb +1 -1
  91. data/lib/ctioga2/metabuilder/types/styles.rb +1 -1
  92. data/lib/ctioga2/plotmaker.rb +12 -7
  93. data/lib/ctioga2/postprocess.rb +1 -1
  94. data/lib/ctioga2/utils.rb +27 -3
  95. metadata +45 -56
data/Changelog CHANGED
@@ -1,3 +1,14 @@
1
+ ctioga2 (0.3)
2
+
3
+ * Implemented a compute-contour command to directly manipulate contours
4
+ * Scripts now import environment variables (makefile-style)
5
+ * Added an apply-formula command to modify already loaded datasets
6
+ * Added a direct backend to input a couple of points directly on
7
+ command-line
8
+ * Improved the stack manipulation functions
9
+
10
+ -- Vincent Fourmond <vincent.fourmond@9online.fr> Mon Sep 3 21:10:34 CEST 2012
11
+
1
12
  ctioga2 (0.2)
2
13
 
3
14
  * Fix small details in the legend positioning in the 'outside' scheme
@@ -16,7 +16,7 @@ require 'ctioga2/commands/type'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 18 $', '$Date: 2009-04-28 23:43:54 +0200 (Tue, 28 Apr 2009) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -17,7 +17,7 @@ require 'ctioga2/commands/groups'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 144 $', '$Date: 2010-04-06 13:31:39 +0200 (Tue, 06 Apr 2010) $')
20
+ Version::register_svn_info('$Revision$', '$Date$')
21
21
 
22
22
  module Commands
23
23
 
@@ -17,7 +17,7 @@ require 'ctioga2/commands/doc/markup'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 138 $', '$Date: 2010-01-21 22:39:55 +0100 (Thu, 21 Jan 2010) $')
20
+ Version::register_svn_info('$Revision$', '$Date$')
21
21
 
22
22
  module Commands
23
23
 
@@ -20,7 +20,7 @@ require 'ctioga2/commands/doc/markup'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 106 $', '$Date: 2009-10-21 01:31:34 +0200 (Wed, 21 Oct 2009) $')
23
+ Version::register_svn_info('$Revision$', '$Date$')
24
24
 
25
25
  module Commands
26
26
 
@@ -18,7 +18,7 @@ require 'ctioga2/commands/doc/wordwrap'
18
18
 
19
19
  module CTioga2
20
20
 
21
- Version::register_svn_info('$Revision: 132 $', '$Date: 2010-01-14 23:18:19 +0100 (Thu, 14 Jan 2010) $')
21
+ Version::register_svn_info('$Revision$', '$Date$')
22
22
 
23
23
  module Commands
24
24
 
@@ -16,7 +16,7 @@ require 'ctioga2/commands/commands'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 216 $', '$Date: 2010-12-31 16:18:17 +0100 (Fri, 31 Dec 2010) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -16,7 +16,7 @@ require 'ctioga2/commands/commands'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 238 $', '$Date: 2011-01-23 21:58:08 +0100 (Sun, 23 Jan 2011) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -18,7 +18,7 @@ require 'ctioga2/commands/parsers/command-line'
18
18
 
19
19
  module CTioga2
20
20
 
21
- Version::register_svn_info('$Revision: 213 $', '$Date: 2010-12-31 02:50:00 +0100 (Fri, 31 Dec 2010) $')
21
+ Version::register_svn_info('$Revision$', '$Date$')
22
22
 
23
23
  module Commands
24
24
 
@@ -16,7 +16,7 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 216 $', '$Date: 2010-12-31 16:18:17 +0100 (Fri, 31 Dec 2010) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -17,7 +17,7 @@ require 'ctioga2/commands/parsers/command-line'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 131 $', '$Date: 2010-01-14 22:51:09 +0100 (Thu, 14 Jan 2010) $')
20
+ Version::register_svn_info('$Revision$', '$Date$')
21
21
 
22
22
  module Commands
23
23
 
@@ -17,7 +17,7 @@ require 'ctioga2/commands/parsers/file'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
20
+ Version::register_svn_info('$Revision$', '$Date$')
21
21
 
22
22
  module Commands
23
23
 
@@ -15,7 +15,7 @@ require 'ctioga2/utils'
15
15
 
16
16
  module CTioga2
17
17
 
18
- Version::register_svn_info('$Revision: 223 $', '$Date: 2011-01-11 01:07:48 +0100 (Tue, 11 Jan 2011) $')
18
+ Version::register_svn_info('$Revision$', '$Date$')
19
19
 
20
20
  module Commands
21
21
 
@@ -16,7 +16,7 @@ require 'ctioga2/metabuilder/types'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 14 $', '$Date: 2009-04-27 21:49:16 +0200 (Mon, 27 Apr 2009) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -20,7 +20,7 @@ require 'ctioga2/commands/doc/doc'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
23
+ Version::register_svn_info('$Revision$', '$Date$')
24
24
 
25
25
  # This module contains the real core of ctioga2: a set of classes
26
26
  # that implement the concept of commands. Each command translates
@@ -180,6 +180,12 @@ module CTioga2
180
180
  @doc = Documentation::Doc.new()
181
181
  @variables = Variables.new
182
182
 
183
+ # We import the variables from the environment, just like a in
184
+ # a Makefile
185
+ for k, v in ENV
186
+ @variables.define_variable(k, v)
187
+ end
188
+
183
189
  @file_parser = Parsers::FileParser.new
184
190
  end
185
191
 
@@ -196,10 +202,10 @@ module CTioga2
196
202
  # the base name of the given file if no figure name was
197
203
  # specified.
198
204
  def run_command_file(file)
199
- @file_parser.run_command_file(file, self)
200
205
  if ! @plotmaker_target.figure_name
201
206
  @plotmaker_target.figure_name = file.gsub(/\.[^.]+$/,'')
202
207
  end
208
+ @file_parser.run_command_file(file, self)
203
209
  end
204
210
 
205
211
  # Parses and runs the given string.
@@ -17,7 +17,7 @@ require 'ctioga2/commands/commands'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 151 $', '$Date: 2010-06-19 23:45:20 +0200 (Sat, 19 Jun 2010) $')
20
+ Version::register_svn_info('$Revision$', '$Date$')
21
21
 
22
22
  module Commands
23
23
 
@@ -19,7 +19,7 @@ require 'ctioga2/commands/strings'
19
19
 
20
20
  module CTioga2
21
21
 
22
- Version::register_svn_info('$Revision: 151 $', '$Date: 2010-06-19 23:45:20 +0200 (Sat, 19 Jun 2010) $')
22
+ Version::register_svn_info('$Revision$', '$Date$')
23
23
 
24
24
  module Commands
25
25
 
@@ -70,6 +70,9 @@ module CTioga2
70
70
  def parse_io_object(io, interpreter)
71
71
  # The process is simple: we look for symbols and
72
72
  # corresponding syntax element: parentheses or assignments
73
+
74
+ ## @todo It would be really great if assignments could be
75
+ ## made conditional (a bit like in makefiles)
73
76
  while(1)
74
77
  symbol = up_to_next_symbol(io)
75
78
  break if not symbol
@@ -16,7 +16,7 @@ require 'stringio' # For debugging purposes
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 2 $', '$Date: 2009-04-25 14:03:30 +0200 (Sat, 25 Apr 2009) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -16,7 +16,7 @@ require 'ctioga2/metabuilder/types'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 173 $', '$Date: 2010-10-22 21:41:39 +0200 (Fri, 22 Oct 2010) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -16,7 +16,7 @@ require 'ctioga2/commands/strings'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
19
+ Version::register_svn_info('$Revision$', '$Date$')
20
20
 
21
21
  module Commands
22
22
 
@@ -32,7 +32,6 @@ module CTioga2
32
32
  # There are two kind of variables
33
33
  # * immediate, defined by
34
34
  # variable := value
35
- # or
36
35
  # These ones are evaluated for once when they are defined.
37
36
  # They are stored in the form of a String
38
37
  # * recursively expanded variables. They are mostly like immediate
@@ -57,10 +56,11 @@ module CTioga2
57
56
  end
58
57
 
59
58
  # Sets a the variable _name_ to _value_ (being an
60
- # InterpreterString or a String). If _interpreter_ is given, the
61
- # value is expanded at the time of the definition, (immediate
62
- # variable), whereas if it stays _nil_, the variable is defined
63
- # as a recursively defined variable.
59
+ # InterpreterString or a String). In the former case
60
+ # (InterpreterString), if _interpreter_ is given, the value is
61
+ # expanded at the time of the definition, (immediate variable),
62
+ # whereas if it stays _nil_, the variable is defined as a
63
+ # recursively defined variable.
64
64
  def define_variable(name, value, interpreter = nil)
65
65
  if value.respond_to? :expand_to_string
66
66
  if interpreter
@@ -21,7 +21,7 @@ require 'ctioga2/data/backends/description'
21
21
 
22
22
  module CTioga2
23
23
 
24
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
24
+ Version::register_svn_info('$Revision$', '$Date$')
25
25
 
26
26
 
27
27
  module Data
@@ -17,6 +17,7 @@
17
17
 
18
18
 
19
19
  require 'ctioga2/data/backends/backend'
20
+ require 'ctioga2/log'
20
21
 
21
22
  # We try to look for all files under a ctioga2/metabuilder/types
22
23
  # directory anywhere on the $: path
@@ -33,7 +34,7 @@ for file in files.uniq
33
34
  begin
34
35
  require "ctioga2/data/backends/backends/#{file}"
35
36
  rescue Exception => e
36
- warn { "There was a problem trying to load 'ctioga2/data/backends/backends/#{file}': " }
37
- warn { "#{e.inspect}" }
37
+ CTioga2::Log::warn { "There was a problem trying to load 'ctioga2/data/backends/backends/#{file}': " }
38
+ CTioga2::Log::warn { "#{e.inspect}" }
38
39
  end
39
40
  end
@@ -0,0 +1,72 @@
1
+ # text.rb : A simple backend to deal with basic text files.
2
+ # Copyright (C) 2006 Vincent Fourmond
3
+
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # (at your option) any later version.
8
+
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+
19
+
20
+ require 'Dobjects/Dvector'
21
+ require 'Dobjects/Function'
22
+
23
+ # For separated sets
24
+ require 'stringio'
25
+
26
+ module CTioga2
27
+
28
+ Version::register_svn_info('$Revision$', '$Date$')
29
+
30
+
31
+ module Data
32
+
33
+ module Backends
34
+
35
+ class DirectBackend < Backend
36
+
37
+ include Dobjects
38
+
39
+ describe 'direct', 'Direct format', <<EOD
40
+ A backend where one enters data points directly on the command
41
+ line or in the command file
42
+ EOD
43
+
44
+ def initialize
45
+ @separator = /\s+/
46
+ @line_separator = /[;,]/
47
+ super()
48
+ end
49
+
50
+ protected
51
+
52
+
53
+
54
+ # This is called by the architecture to get the data. It
55
+ # splits the set name into filename@cols, reads the file if
56
+ # necessary and calls get_data
57
+ def query_dataset(set)
58
+ str = set.gsub(@line_separator, "\n")
59
+ io = StringIO.new(str)
60
+
61
+ cols = Dvector::fancy_read(io, nil)
62
+
63
+ return Dataset.new("direct", cols)
64
+ end
65
+
66
+
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+ end
@@ -25,7 +25,7 @@ require 'stringio'
25
25
 
26
26
  module CTioga2
27
27
 
28
- Version::register_svn_info('$Revision: 151 $', '$Date: 2010-06-19 23:45:20 +0200 (Sat, 19 Jun 2010) $')
28
+ Version::register_svn_info('$Revision$', '$Date$')
29
29
 
30
30
 
31
31
  module Data
@@ -21,7 +21,7 @@ require 'Dobjects/Function'
21
21
 
22
22
  module CTioga2
23
23
 
24
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
24
+ Version::register_svn_info('$Revision$', '$Date$')
25
25
 
26
26
  module Data
27
27
 
@@ -25,7 +25,7 @@ require 'stringio'
25
25
 
26
26
  module CTioga2
27
27
 
28
- Version::register_svn_info('$Revision: 191 $', '$Date: 2010-11-07 15:53:08 +0100 (Sun, 07 Nov 2010) $')
28
+ Version::register_svn_info('$Revision$', '$Date$')
29
29
 
30
30
 
31
31
  module Data
@@ -55,7 +55,7 @@ module CTioga2
55
55
  include Dobjects
56
56
 
57
57
  describe 'text', 'Text format', <<EOD
58
- This backend can read text files in a format close to the one understood
58
+ This backend reads text files in a format close to the one understood
59
59
  by gnuplot and the like.
60
60
  EOD
61
61
 
@@ -289,6 +289,11 @@ EOD
289
289
  # instance in the automatic labels ? (and we could have fun
290
290
  # improving this one ?)
291
291
  #
292
+ # @todo There should be a way to read pure text columns and
293
+ # use them somehow, to annotate the output ? This should be
294
+ # implemented at the Tioga level, though (both for reading, in
295
+ # fancy_read, and for using hover stuff)
296
+ #
292
297
  # \warning This needs Tioga r561
293
298
  def read_file(file)
294
299
  if file =~ /(.*)@.*/
@@ -361,18 +366,7 @@ EOD
361
366
  def get_data_column(column, compute_formulas = false,
362
367
  parameters = nil, header = nil)
363
368
  if compute_formulas
364
- formula = column
365
- if parameters
366
- for k,v in parameters
367
- formula.gsub!(/\b#{k}\b/, v.to_s)
368
- end
369
- end
370
- formula.gsub!(/\$(\d+)/, 'column[\1]')
371
- if header
372
- for k,v in header
373
- formula.gsub!("$#{k}$", "column[#{v}]")
374
- end
375
- end
369
+ formula = Utils::parse_formula(column, parameters, header)
376
370
  debug { "Using formula #{formula} for column spec: #{column}" }
377
371
  return Dvector.compute_formula(formula,
378
372
  @current_data,
@@ -22,7 +22,7 @@ require 'ctioga2/commands/groups'
22
22
 
23
23
  module CTioga2
24
24
 
25
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
25
+ Version::register_svn_info('$Revision$', '$Date$')
26
26
 
27
27
 
28
28
  module Data
@@ -179,10 +179,14 @@ module CTioga2
179
179
  backend_options, "Selects the '{backend: #{@name}}' backend",
180
180
  nil, group) do |plotmaker, options|
181
181
  plotmaker.data_stack.backend_factory.set_current_backend(@name)
182
- for k,v in options
183
- plotmaker.data_stack.backend_factory.
184
- set_backend_parameter_value(@name, k, v)
185
- end
182
+ if options
183
+ for k,v in options
184
+ plotmaker.data_stack.backend_factory.
185
+ set_backend_parameter_value(@name, k, v)
186
+ end
187
+ end # Commands#run_command set options to
188
+ # nil if the options hash is an empty hash, so we have to
189
+ # tackle this if it happens
186
190
  end
187
191
  end
188
192