~ubuntu-branches/ubuntu/quantal/software-center/quantal-updates

« back to all changes in this revision

Viewing changes to softwarecenter/utils.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, Anthony Lenton, Gary Lasker, Natalia Bidart
  • Date: 2012-03-09 08:55:46 UTC
  • Revision ID: package-import@ubuntu.com-20120309085546-p7p4ppu59ishighc
Tags: 5.1.12
[ Michael Vogt ]
* lp:~mvo/software-center/webcam-string-fix:
- small fix to support the debtagshw updated tags for hardware::camera
  (split into webcam,digicam now)
* lp:~mvo/software-center/trivial-nm-state-override:
  - support the SOFTWARE_CENTER_NET_CONNECTED environment value to
    force the connected state as a stopgap workaround for bug 911706
* lp:~mvo/software-center/lp941361:
  - adds a general make_string_from_list() helper to build (somewhat)
    i18n friendly human readable strings easily (LP: #941361)
* lp:~mvo/software-center/expunge-cache:
  - merge os.nice() addition
* lp:~mvo/software-center/lp789596:
  - better (less scary) string for updates from third-party
    venders (LP: #789596)
* lp:~mvo/software-center/fix-refresh-of-whats-new:
  - fix missing refresh of the what's new content on a database
    reopen so that new content from the agent appears as soon
    as it finishes the update
* lp:~mvo/software-center/review-fixes:
  - ensure ui is correctly updated after submitting/modifying review
* lp:~mvo/software-center/simulate-slow-network:
  - add a small helper to simulate a slow network connection to
    see if we have hidden latencies in the UI when the network
    is (really) slow
* lp:~mvo/software-center/top-rated-refresh:
  - ensure that the top-rated apps are refreshed when we have new data
* lp:~mvo/software-center/apptreeview-tweaks:
  - fix 'load_range" errors when navigating the installed view
    (LP: #913675), and do some nice needed refactoring/cleanup

[ Anthony Lenton ]
* lp:~elachuni/software-center/dont-store:
  - consolidate Ubunty SSO logins to use "Ubuntu Software Center", fixes
    inconsistent UI and storing of two keys in they keyring, as well as
    being prompted to log in twice the first time that you review an app
* lp:~elachuni/software-center/pep8-test,
  lp:~elachuni/software-center/pep8-test-part2,
  lp:~elachuni/software-center/pep8-test-part3,
  lp:~elachuni/software-center/pep8-test-part4:
  - add a unit test to check code statically for pep8 compliance and update
    more and more of the code to meet it

[ Gary Lasker ]
* lp:~gary-lasker/software-center/fix-crash-lp944875:
  - Fix an intermittent crash that can happen if the installed view pane
    has not been built yet when a call to show the spinner is made as a
    result of a refresh (LP: #944875)
* lp:~gary-lasker/software-center/list-view-icon-coordinates-lp947624:
  - This branch adds support for providing the correct icon size and 
    on-screen coordinates values in the Unity launcher integration dbus 
    call when an installation is initiated via the list view
    (LP: #947624)
* lp:~gary-lasker/software-center/enable-published-date-unit-test:
  - unit test change only, enable the published-date unit test that was
    disabled pending deployment of support on the staging server

[ Natalia Bidart ]
* lp:~nataliabidart/software-center/one-auth:
  - use consistently the same app name for every Ubuntu SSO call to
    ensure SSO tokens are handled properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
706
706
        self.emit('file-download-complete', self.dest_file_path)
707
707
 
708
708
 
709
 
 
 
709
def make_string_from_list(base_str, item_list):
 
710
    """ This function takes a list of items and builds a nice human readable
 
711
        string with it of the form. Note that the base string needs a "%s".
 
712
        Example return:
 
713
          The base string with the list items a,b and c in it.
 
714
        Note that base_str needs to be a ngettext string already, so the
 
715
        example usage is:
 
716
         l = ["foo", "bar"]
 
717
         base_str = ngettext("This list: %s.", "This list: %s", len(l))
 
718
         s = make_string_from_list(base_string, l)
 
719
    """
 
720
    list_str = item_list[0]
 
721
    if len(item_list) > 1:
 
722
        # TRANSLATORS: this is a generic list delimit char, e.g. "foo, bar"
 
723
        list_str = _(", ").join(item_list[:-1])
 
724
        # TRANSLATORS: this is the last part of a list, e.g. "foo, bar and baz"
 
725
        list_str = _("%s and %s") % (list_str,
 
726
                                     item_list[-1])
 
727
    s = base_str % list_str
 
728
    return s
710
729
 
711
730
 
712
731
# those helpers are packaging system specific