euscanwww: Minor cleanings

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-08-14 13:51:07 +02:00
parent f2a4d5d4a4
commit ec2e132583
4 changed files with 8 additions and 3 deletions

View File

@ -127,6 +127,7 @@ def get_account_versionlogs(profile):
Q(package__in=packages) | Q(overlay__in=overlays) Q(package__in=packages) | Q(overlay__in=overlays)
) )
def get_user_fav_infos(user): def get_user_fav_infos(user):
upstream_k = lambda c: c["n_versions"] - c["n_packaged"] - c["n_overlay"] upstream_k = lambda c: c["n_versions"] - c["n_packaged"] - c["n_overlay"]

View File

@ -221,6 +221,8 @@ def update_upstream():
@task @task
def scan_package(package): def scan_package(package):
logger = scan_package.get_logger()
logger.info("Scanning package %s", package)
scan_portage([package], purge_packages=True, purge_versions=True) scan_portage([package], purge_packages=True, purge_versions=True)
scan_metadata([package]) scan_metadata([package])
scan_upstream([package]) scan_upstream([package])
@ -272,7 +274,8 @@ def consume_refresh_queue(locked=False):
def send_user_email(address, subject, text): def send_user_email(address, subject, text):
try: try:
send_mail( send_mail(
subject, text, settings.DEFAULT_FROM_EMAIL, [address], fail_silently=False subject, text, settings.DEFAULT_FROM_EMAIL, [address],
fail_silently=False
) )
except Exception, exc: except Exception, exc:
raise send_user_email.retry(exc=exc) raise send_user_email.retry(exc=exc)

View File

@ -402,10 +402,11 @@ def accounts_index(request):
user = request.user user = request.user
infos = get_user_fav_infos(user) infos = get_user_fav_infos(user)
infos['vlog'] = UserFeed().items({'user':user, 'options' : {}}) infos['vlog'] = UserFeed().items({'user': user, 'options': {}})
return infos return infos
@login_required @login_required
@render_to('euscan/accounts/preferences.html') @render_to('euscan/accounts/preferences.html')
def accounts_preferences(request): def accounts_preferences(request):

View File

@ -58,7 +58,7 @@ def parse_src_uri(uris):
uri = from_mirror(uri) uri = from_mirror(uri)
if uris and uris[-1] == "->": if uris and uris[-1] == "->":
operator = uris.pop() uris.pop() # operator
file_ = uris.pop() file_ = uris.pop()
else: else:
file_ = os.path.basename(uri) file_ = os.path.basename(uri)