Merge lp:~mvo/archive-index/mvo into lp:archive-index

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3
Proposed branch: lp:~mvo/archive-index/mvo
Merge into: lp:archive-index
Diff against target: 41 lines (+12/-2)
2 files modified
extract-app-metadata (+11/-1)
src/ArchiveCache/__init__.py (+1/-1)
To merge this branch: bzr merge lp:~mvo/archive-index/mvo
Reviewer Review Type Date Requested Status
Jjed Approve
Review via email: mp+70121@code.launchpad.net

Description of the change

Minor tweaks:
- add --verbose to the commandline
- add ARCHIVE_INDEX_CACHE_DIR environment (for people like me with a small ~/ but lots of space on /space :)

Thanks,
 Michael

To post a comment you must log in.
lp:~mvo/archive-index/mvo updated
3. By Jacob Johan Edwards

Merged cache and logging options from lp:~mvo/archive-index/mvo. Thanks!

Revision history for this message
Jjed (jjed) wrote :

Useful options. I've merged to the app-install branch too.

Thanks,
Jacob

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extract-app-metadata'
2--- extract-app-metadata 2011-06-24 19:56:58 +0000
3+++ extract-app-metadata 2011-08-02 07:56:24 +0000
4@@ -17,7 +17,10 @@
5 Option("-o", "--out-dir", dest="out_dir", default="output/",
6 help="directory where extracted metadata will output"),
7 Option("-m", "--memory", type="int", dest="memory", default=500,
8- help="how many megabytes of data to load into memory"))
9+ help="how many megabytes of data to load into memory"),
10+ Option("-v", "--verbose", default=False, action="store_true",
11+ help="show more output to stdout"),
12+ )
13
14
15 if __name__ == "__main__":
16@@ -39,5 +42,12 @@
17 logging.basicConfig(level=logging.DEBUG, filename=out_log, filemode="w",
18 format="%(asctime)s %(levelname)s %(message)s")
19
20+ # create output on stdout
21+ if opts.verbose:
22+ log = logging.getLogger()
23+ handler = logging.StreamHandler()
24+ log.addHandler(handler)
25+ del kwargs["verbose"]
26+
27 # extract
28 extract_metadata(**kwargs)
29
30=== modified file 'src/ArchiveCache/__init__.py'
31--- src/ArchiveCache/__init__.py 2011-07-29 01:35:15 +0000
32+++ src/ArchiveCache/__init__.py 2011-08-02 07:56:24 +0000
33@@ -11,7 +11,7 @@
34 from ..utils import md5sum, file_type
35
36 # TODO: Use xdg.BaseDirectory when ready for python3
37-CACHE_DIR = os.path.expandvars("$HOME/.cache/archive-cache")
38+CACHE_DIR = os.environ.get("ARCHIVE_INDEX_CACHE_DIR") or os.path.expandvars("$HOME/.cache/archive-cache")
39
40
41 class ArchiveCache:

Subscribers

People subscribed via source and target branches

to all changes: