Commits

Anonymous committed 0b3bb0f

refactor: changing the default factory name

  • Participants
  • Parent commits 686be0d

Comments (0)

Files changed (1)

ropemacs/refactor.py

     optionals = {
         'docs': dialog.Data('Rename occurrences in comments and docs: ',
                             values=['yes', 'no'], default='yes'),
-        'in_hierarchy': dialog.Data('Method in class hierarchy: ',
+        'in_hierarchy': dialog.Data('Rename methods in class hierarchy: ',
                                     values=['yes', 'no'], default='no'),
         'resources': dialog.Data('Files to apply this refactoring on: '),
         'unsure': dialog.Data('Unsure occurrences: ',
 class IntroduceFactory(Refactoring):
     saveall = True
     key = 'f'
-    confs = {'factory_name': dialog.Data('Factory name: ', default='create_object')}
     optionals = {'global_factory': dialog.Data(
             'Make global: ', values=['yes', 'no'], default='yes'),
                  'resources': dialog.Data('Files to apply this refactoring on: ')}
                                         resources=resources,
                                         task_handle=task_handle)
 
+    def _get_confs(self):
+        default = 'create_%s' % self.factory.old_name.lower()
+        return {'factory_name': dialog.Data('Factory name: ', default)}
+
 
 class _GenerateElement(Refactoring):