Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: commit-queue/creds.py

Issue 135363007: Delete public commit queue to avoid confusion after move to internal repo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « commit-queue/cq_alerts.py ('k') | commit-queue/errors.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 """Loads credentials."""
5
6 import os
7
8 import errors
9
10
11 class Credentials(object):
12 """Keeps a dictionary of accounts."""
13
14 def __init__(self, pwd_path):
15 try:
16 content = open(pwd_path, 'r').read()
17 except IOError:
18 raise errors.ConfigurationError(
19 '%s is missing. Please read workdir/README.' %
20 os.path.basename(pwd_path))
21 lines = [l.strip() for l in content.splitlines()]
22 lines = [l for l in lines if l and not l.startswith('#')]
23 self.creds = {}
24 for l in lines:
25 items = l.split(':', 1)
26 self.creds[items[0].strip()] = items[1].strip()
27
28 def get(self, user):
29 return self.creds.get(user, None)
OLDNEW
« no previous file with comments | « commit-queue/cq_alerts.py ('k') | commit-queue/errors.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698