Skip to content

Commit

Permalink
Some tweaks of this bit of code
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Mar 14, 2011
1 parent d0e1f2f commit 07e0ad2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/package/handlers/launchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@


def pull(package):

cachedir = getattr(settings, 'LAUNCHPAD_CACHE_DIR', os.path.join(settings.PROJECT_ROOT, 'lp-cache'))
launchpad = Launchpad.login_anonymously('djangopackages.com', 'production', cachedir)
repo_name = package.repo_name()
repo_name = package.repo_name().replace('https://code.launchpad.net/','')

branch = launchpad.branches.getByUrl(url='lp:%s' % repo_name)


package.repo_description = branch.description or ''
package.repo_forks = len(branch.project.getBranches())
package.repo_watchers = len(branch.subscribers)
Expand Down
4 changes: 4 additions & 0 deletions apps/package/management/commands/package_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def handle(self, *args, **options):
message = "For '%s', too many requests issued to repo threw a RuntimeError: %s" % (package.title, e)
print >> stdout, message
continue
except UnicodeDecodeError, e:
message = "For '%s', UnicodeDecodeError: %s" % (package.title, e)
print >> stdout, message
continue

if not authed:
sleep(zzz)
Expand Down
2 changes: 1 addition & 1 deletion requirements/project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ python-dateutil==1.5
django-reversion==1.3.1
django-sorting==0.1
bzr==2.3.1
launchpadlib==1.9.8
launchpadlib==1.9.8

0 comments on commit 07e0ad2

Please sign in to comment.