1. Nicolae Dascalu
  2. ropemacs


Ali Gholami Rudi  committed 638e68b

Skipping blanks in batchset

  • Participants
  • Parent commits efdaa40
  • Branches trunk

Comments (0)

Files changed (4)

File README.txt

View file
  • Ignore whitespace
 New Features
+* Find occurrences; ``C-c f``
+* Lucky-assist; ``M-?``
+* Setting many configs using batchset in dialogs
+* Showing the old value of a field in dialogs
+* New file/directory/module/package; ``C-x p n [fdmp]``
+* Edit project config; ``C-x p c``
+* Updating buffers with moved files after refactorings
 Setting Up
-``rope-code-assist`` (``M-/`` by default) function will let you select
+``rope-code-assist`` command (``M-/`` by default) will let you select
 from a list of completions.  If prefixed (``C-u M-/``), ropemacs
 inserts the common prefix, automatically.  If a numeric argument is
 given, rope will insert the common prefix for that many of the first
-The ``rope-lucky-assist`` (``M-?``) does not ask, anything; instead,
-it inserts the first proposal.  By prefixing it, you can select which
-proposal to use.  ``C-u 1 M-?`` uses the second propsal, for instance.
+``rope-lucky-assist`` command (``M-?``) does not ask, anything;
+instead, it inserts the first proposal.  By prefixing it, you can
+choose which proposal to insert.  ``C-u 1 M-?`` uses the second
+propsal, for instance.
 ============  ==========  =======================
-Dialog batchset command
+Dialog ``batchset`` Command
 When you use rope dialogs there is a command called ``batchset``.  It
 can be used to set many configs at the same time.  After selecting
 this command from dialog base prompt, you are asked to enter a string.
-Batch-set strings can give value to configs in two ways.  The single
-line form is like this::
+``batchset`` strings can give value to configs in two ways.  The
+single line form is like this::
   name1 value1
   name2 value2
    ?pycore.type == rope.base.pycore.PyCore
    ?project.type == rope.base.project.Project
-Now this string can be used for ``batchset`` string in restructuring
+This is a valid ``batchset`` string for restructurings.  When using
+batchset, you usually want to skip initial questions.  That can be
+done by prefixing refactorings.

File docs/todo.txt

View file
  • Ignore whitespace
 > Public Release 1.0
+> Public Release 0.4
 * adding a menu
 * including pymacs in ropemacs?
 * change pymacs to accept unicode strings
 * saving the old values of refacturing config
+* showing proposal type in code-assist
-> Public Release 0.3
-* showing proposal type in code-assist
+> Public Release 0.3 : December 5, 2007

File ropemacs/dialog.py

View file
  • Ignore whitespace
             value = ''
             if len(tokens) > 1:
                 result.append([tokens[0], tokens[1].rstrip('\r\n')])
-            else:
+            elif len(tokens) > 0:
                 multiline = True
                 result.append([tokens[0], ''])
     return dict(result)

File ropemacstest.py

View file
  • Ignore whitespace
              'name3': 'value3\n'}, result)
         self.assertEquals('done', action)
+    def test_skipping_blanks(self):
+        optionals = {'name1': dialog.Data(), 'name2': dialog.Data()}
+        minibuffer = _MockAskConfig(
+            ['batchset', '\nname1\n value1\n\nname2 value2\n\n', 'done'])
+        action, result = dialog.show_dialog(minibuffer, ['done', 'cancel'],
+                                            optionals=optionals)
+        self.assertEquals(
+            {'name1': 'value1\n', 'name2': 'value2'}, result)
+        self.assertEquals('done', action)
     def test_skip_initial_asking(self):
         confs = {'name': dialog.Data()}
         minibuffer = _MockAskConfig(