Ignore:
Timestamp:
05/21/10 02:03:48 (2 years ago)
Author:
Luper Rouch <luper.rouch@…>
Children:
a6b884ed033bd91214c084f36a80eb9a0e049c6a
Parents:
eb367573c9a8c777f3776814ffd2d795e688b2ef
git-committer:
Luper Rouch <luper.rouch@…> (05/21/10 02:03:48)
Message:

pyflu:

  • jsonalize: UnregisteredClassError? now has the offending class name in its 'class_name' attribute
  • qt.util: settings_path parameter is now optional in get_open_path()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyflu/pyflu/qt/util.py

    r782716f rba4fbc6  
    6767 
    6868 
    69 def get_open_path(parent, settings_path, filter=None): 
     69def get_open_path(parent, settings_path=None, filter=None): 
    7070    """ 
    7171    Shows an 'open file' dialog and returns the selected path. 
    7272 
    7373    Also remembers the selected folder, so that subsequent calls to this 
    74     function with the same ``settings_path`` will open in the last selected 
     74    function with the same *settings_path* will open in the last selected 
    7575    directory. 
    7676 
    77     If ``filter`` is specified, it must be an iterable containing filters 
    78     definitions. See the ``format_file_dialog_filter_string()`` docstring for 
     77    If *filter* is specified, it must be an iterable containing filters 
     78    definitions. See the :func:`format_file_dialog_filter_string` docstring for 
    7979    details. 
    8080 
     
    8383    # Get the last used save directory 
    8484    settings = QSettings() 
    85     last_dir = unicode(settings.value(settings_path, QVariant(u"")).toString()) 
     85    if settings_path is not None: 
     86        last_dir = unicode(settings.value(settings_path, 
     87            QVariant(u"")).toString()) 
     88    else: 
     89        last_dir = QString() 
    8690    # Get save location 
    8791    if filter is not None: 
     
    9498        return None 
    9599    open_path = unicode(open_path) 
    96     # Remember save location directory 
    97     settings.setValue(settings_path, QVariant(dirname(open_path))) 
     100    if settings_path is not None: 
     101        # Remember save location directory 
     102        settings.setValue(settings_path, QVariant(dirname(open_path))) 
    98103    return open_path 
    99104 
Note: See TracChangeset for help on using the changeset viewer.