Changeset 251


Ignore:
Timestamp:
25-05-07 15:47:47 (6 years ago)
Author:
thomas
Message:
  • moap/util/deps.py (getTicketURL, handleMissingDependency): Make it easier to file a bug on a missing dependency.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r250 r251  
     12007-05-25  Thomas Vander Stichele  <thomas at apestaart dot org> 
     2 
     3        * moap/util/deps.py (getTicketURL, handleMissingDependency): 
     4          Make it easier to file a bug on a missing dependency. 
     5 
    162007-05-25  Thomas Vander Stichele  <thomas at apestaart dot org> 
    27 
  • trunk/moap/util/deps.py

    r250 r251  
    55# missing dependency 
    66 
     7import os 
     8import sys 
     9import urllib 
     10 
    711from moap.util import distro 
    8  
    9 import sys 
    1012 
    1113class Dependency: 
     
    119121    raise 
    120122 
     123def getTicketURL(summary): 
     124    reporter = os.environ.get('EMAIL_ADDRESS', None) 
     125    get = "summary=%s" % urllib.quote(summary) 
     126    if reporter: 
     127        get += "&reporter=%s" % urllib.quote(reporter) 
     128    return 'https://thomas.apestaart.org/moap/trac/newticket?' + get 
     129  
    121130def handleMissingDependency(dep): 
    122131    if dep.homepage: 
     
    129138            sys.stderr.write(howto) 
    130139        else: 
    131             sys.stderr.write( 
    132                 "On %s, MOAP does not know how to install %s.\n"  
    133                 "Please file a bug so we can add this dependency.\n" % ( 
    134                     d.description, dep.module)) 
     140            url = getTicketURL('DEP: %s, %s' % (dep.module, d.description)) 
     141            sys.stderr.write("""On %s, MOAP does not know how to install %s. 
     142Please file a bug at: 
     143%s 
     144with instructions on how to install the dependency so we can add it. 
     145""" % (d.description, dep.module, url)) 
    135146    else: 
     147        url = getTicketURL('DISTRO: Unknown') 
    136148        sys.stderr.write("""MOAP does not know your distribution. 
    137 Please file a bug so we can add your distribution. 
    138 """) 
     149Please file a bug at: 
     150%s 
     151with instructions on how to recognize your distribution so we can add it. 
     152""" % url) 
    139153 
    140154    sys.stderr.write('\n') 
Note: See TracChangeset for help on using the changeset viewer.