Merge lp:~fginther/notes-app/fix-db-path into lp:notes-app

Proposed by Francis Ginther
Status: Merged
Approved by: Loïc Minier
Approved revision: 199
Merged at revision: 198
Proposed branch: lp:~fginther/notes-app/fix-db-path
Merge into: lp:notes-app
Diff against target: 28 lines (+13/-4)
1 file modified
tests/autopilot/notes_app/tests/__init__.py (+13/-4)
To merge this branch: bzr merge lp:~fginther/notes-app/fix-db-path
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Loïc Minier Approve
Review via email: mp+189492@code.launchpad.net

This proposal supersedes a proposal from 2013-10-03.

Commit message

Provide alternate location of offline storage in response to sdk change.

Description of the change

Provide alternate location of offline storage in response to sdk change (see lp:1231863).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Loïc Minier (lool) wrote : Posted in a previous version of this proposal

Could you get the name from Qt/SDK instead of harcoding it? Otherwise we have to ensure the test and the updated SDK land at exactly the same time, and if the location changes again, it will break again.

Revision history for this message
Francis Ginther (fginther) wrote :

New version attempts to use the new path first. Yes it could do better and actually look for the db file, not just check the path.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~fginther/notes-app/fix-db-path updated
199. By Francis Ginther

Need to return the os.path.expanduser path.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Loïc Minier (lool) wrote :

Looks good, thanks for trying the two pathnames.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/notes_app/tests/__init__.py'
--- tests/autopilot/notes_app/tests/__init__.py 2013-09-30 22:20:59 +0000
+++ tests/autopilot/notes_app/tests/__init__.py 2013-10-06 04:34:02 +0000
@@ -183,11 +183,20 @@
183 Helper functions for dealing with sqlite databases183 Helper functions for dealing with sqlite databases
184 """184 """
185185
186 def _get_db_path(self):
187 db_path_list = [
188 "~/.local/share/notes-app/Databases",
189 "~/.local/share/Qt Project/QtQmlViewer/QML/OfflineStorage/"
190 "Databases/"]
191 for path in db_path_list:
192 path = os.path.expanduser(path)
193 if os.path.exists(path):
194 return path
195 return None
196
186 def find_db(self):197 def find_db(self):
187 dbs_path = os.path.expanduser(198 dbs_path = self._get_db_path()
188 "~/.local/share/Qt Project/QtQmlViewer/QML/OfflineStorage/"199 if not dbs_path:
189 "Databases/")
190 if not os.path.exists(dbs_path):
191 return None200 return None
192 files = [f for f in os.listdir(dbs_path)201 files = [f for f in os.listdir(dbs_path)
193 if os.path.splitext(f)[1] == ".ini"]202 if os.path.splitext(f)[1] == ".ini"]

Subscribers

People subscribed via source and target branches