~bkidwell/zim/pyzim-win-installer

« back to all changes in this revision

Viewing changes to zim/config.py

  • Committer: Jaap Karssenberg
  • Date: 2011-05-10 20:58:36 UTC
  • mfrom: (391.2.7 quick_fixes)
  • Revision ID: pardus@cpan.org-20110510205836-monwocmkfylr7ms2
Merging 3 fixes:
* Remember position of main window and dialogs (within one instance)
* Make search hand over partial searches correctly to find
* When copying attachments keep the modification time etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
485
485
        As a special case we can support sections that repeat under the
486
486
        same section name. To do this assign the section name a list
487
487
        before parsing.
 
488
 
 
489
        Values with keys starting with '_' are considered as non-persistent and are
 
490
        only stored during one session of Zim. They will not appear in the INI file.
488
491
        '''
489
492
 
490
493
        def __getitem__(self, k):
547
550
 
548
551
        def dump(self):
549
552
                '''Returns a list of lines with text representation of the
550
 
                dict. Used to write as a config file.
 
553
                dict. Used to write as a config file. Values with keys starting with '_'
 
554
                are considered as non-persistent and will be skipped.
551
555
                '''
552
556
                lines = []
553
557
                def dump_section(name, parameters):
554
558
                        lines.append('[%s]\n' % section)
555
559
                        for param, value in parameters.items():
556
 
                                lines.append('%s=%s\n' % (param, self._encode_value(value)))
 
560
                                if not param.startswith('_'):
 
561
                                        lines.append('%s=%s\n' % (param, self._encode_value(value)))
557
562
                        lines.append('\n')
558
563
 
559
564
                for section, parameters in self.items():