Merge lp:~dobey/ubuntuone-dev-tools/home-is-trial-temp into lp:ubuntuone-dev-tools

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 30
Merged at revision: 29
Proposed branch: lp:~dobey/ubuntuone-dev-tools/home-is-trial-temp
Merge into: lp:ubuntuone-dev-tools
Diff against target: 66 lines (+23/-6)
3 files modified
bin/u1lint (+2/-0)
bin/u1trial (+19/-5)
pylintrc (+2/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-dev-tools/home-is-trial-temp
Reviewer Review Type Date Requested Status
Facundo Batista (community) Approve
Guillermo Gonzalez Approve
Review via email: mp+57507@code.launchpad.net

Commit message

Disable lint error in u1lint
Disable W0404 lint warnings, as they seem to be erroneous
Set the HOME and more XDG env vars, for cron, and to avoid user's $HOME

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

looks good! +1

review: Approve
Revision history for this message
Facundo Batista (facundo) wrote :

Like it!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/u1lint'
2--- bin/u1lint 2010-12-22 16:56:33 +0000
3+++ bin/u1lint 2011-04-13 15:02:50 +0000
4@@ -122,9 +122,11 @@
5 config = ConfigParser.ConfigParser()
6 config.read([PYLINTRC])
7
8+ # pylint: disable=E1103
9 return config.get("MASTER", "ignore").split(",")
10 except (TypeError, ConfigParser.NoOptionError):
11 return None
12+ # pylint: enable=E1103
13
14 def _group_lines_by_file(data):
15 """Format file:line:message output as lines grouped by file."""
16
17=== modified file 'bin/u1trial'
18--- bin/u1trial 2011-03-31 17:27:43 +0000
19+++ bin/u1trial 2011-04-13 15:02:50 +0000
20@@ -84,13 +84,27 @@
21 _install_reactor(qt_reactor)
22 from twisted.trial.reporter import TreeReporter
23
24- # setup a custom XDG_CACHE_HOME and create the logs directory
25- xdg_cache = os.path.join(os.getcwd(), "_trial_temp", "xdg_cache")
26- os.environ["XDG_CACHE_HOME"] = xdg_cache
27+ # set $HOME to the _trial_temp dir, to avoid breaking user files
28+ homedir = os.path.join(os.getcwd(), '_trial_temp')
29+ os.environ['HOME'] = homedir
30+
31+ # setup $XDG_*_HOME variables and create the directories
32+ xdg_cache = os.path.join(homedir, 'xdg_cache')
33+ xdg_config = os.path.join(homedir, 'xdg_config')
34+ xdg_data = os.path.join(homedir, 'xdg_data')
35+ os.environ['XDG_CACHE_HOME'] = xdg_cache
36+ os.environ['XDG_CONFIG_HOME'] = xdg_config
37+ os.environ['XDG_DATA_HOME'] = xdg_data
38+
39+ if not os.path.exists(xdg_cache):
40+ os.makedirs(xdg_cache)
41+ if not os.path.exists(xdg_config):
42+ os.makedirs(xdg_config)
43+ if not os.path.exists(xdg_data):
44+ os.makedirs(xdg_data)
45+
46 # setup the ROOTDIR env var
47 os.environ['ROOTDIR'] = os.getcwd()
48- if not os.path.exists(xdg_cache):
49- os.makedirs(xdg_cache)
50
51 self.tempdir = os.path.join(os.getcwd(), "_trial_temp")
52 working_dir = os.path.join(self.tempdir, 'tmp')
53
54=== modified file 'pylintrc'
55--- pylintrc 2010-10-13 19:20:56 +0000
56+++ pylintrc 2011-04-13 15:02:50 +0000
57@@ -50,7 +50,8 @@
58 # W0142: Used * or ** magic
59 # W0221: Arguments number differs from %s method (pylint is confused by * and **)
60 # W0613: Unused argument %r (We get lots of these from interfaces)
61-disable=R,I,W0142,W0221,W0613
62+# W0404: Erroneous re-import warning: MM: X Reimported (line MM)
63+disable=R,I,W0142,W0221,W0613,W0404
64
65
66 [REPORTS]

Subscribers

People subscribed via source and target branches

to all changes: