Software Freedom Law Center

Show
Ignore:
Timestamp:
03/07/08 15:30:10 (10 months ago)
Author:
bkuhn
Message:

Load ./upstream-trac into branches/trac.upstream-r6669.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/trac.upstream-r6669/cgi-bin/trac.cgi

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/cgi-bin/trac.fcgi

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/checkwiki.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/htdigest.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/rpm/makerpm

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/trac-post-commit-hook

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/workflow/migrate_original_to_basic.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/workflow/showworkflow

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/contrib/workflow/workflow_parser.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/sample-plugins/permissions/vulnerability_tickets.py

    r46 r52  
    22from trac.perm import IPermissionPolicy, IPermissionRequestor 
    33 
    4 revision = "$Rev: 2 $" 
     4revision = "$Rev: 41 $" 
    55url = "$URL: /mirror/sample-plugins/permissions/vulnerability_tickets.py $" 
    66 
     
    4141            db = self.env.get_db_cnx() 
    4242            cursor = db.cursor() 
    43             for keywords, summary in cursor.execute("SELECT keywords, summary " 
    44                                                     " FROM ticket WHERE id=%s", 
    45                                                     (resource.id,))
     43            cursor.execute("SELECT keywords, summary FROM ticket WHERE id=%s", 
     44                           (resource.id,)) 
     45            for keywords, summary in cursor
    4646                fields = ''.join([f for f in (keywords, summary) if f]).lower() 
    4747                if 'security' in fields or 'vulnerability' in fields: 
  • branches/trac.upstream-r6669/setup.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/trac/admin/console.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/trac/admin/web_ui.py

    r46 r52  
    3131from trac.util import get_pkginfo, get_module_path 
    3232from trac.util.compat import partial 
     33from trac.util.text import to_unicode 
    3334from trac.util.translation import _ 
    3435from trac.web import HTTPNotFound, IRequestHandler 
     
    396397            raise TracError(_('No file uploaded')) 
    397398        upload = req.args['plugin_file'] 
    398         if not upload.filename: 
     399        if isinstance(upload, unicode) or not upload.filename: 
    399400            raise TracError(_('No file uploaded')) 
    400401        plugin_filename = upload.filename.replace('\\', '/').replace(':', '/') 
     
    481482                plugin_filename = os.path.basename(dist.location) 
    482483 
    483             description = inspect.getdoc(component
     484            description = to_unicode(inspect.getdoc(component)
    484485            if description: 
    485486                description = description.split('.', 1)[0] + '.' 
  • branches/trac.upstream-r6669/trac/attachment.py

    r46 r52  
    372372            parent_id = '/'.join(segments[:-1]) 
    373373            filename = len(segments) > 1 and segments[-1] 
    374             if not filename: # if there's a trailing '/', show the list 
    375                 return self._render_list(req, parent_realm(id=parent_id)) 
    376374 
    377375        parent = parent_realm(id=parent_id) 
     376         
     377        # Link the attachment page to parent resource 
     378        parent_name = get_resource_name(self.env, parent) 
     379        parent_url = get_resource_url(self.env, parent, req.href) 
     380        add_link(req, 'up', parent_url, parent_name) 
     381        add_ctxtnav(req, _('Back to %(parent)s', parent=parent_name),  
     382                    parent_url) 
     383         
     384        if action != 'new' and not filename:  
     385            # there's a trailing '/', show the list 
     386            return self._render_list(req, parent) 
     387 
    378388        attachment = Attachment(self.env, parent.child('attachment', filename)) 
    379          
    380         add_link(req, 'up', get_resource_url(self.env, parent, req.href), 
    381                  get_resource_name(self.env, parent)) 
    382389         
    383390        if req.method == 'POST': 
     
    394401 
    395402        add_stylesheet(req, 'common/css/code.css') 
    396         add_ctxtnav(req, _('Back to %(parent)s',  
    397                            parent=get_resource_name(self.env, parent)),  
    398                     req.chrome['links']['up'][0]['href']) 
    399403        return 'attachment.html', data, None 
    400404 
     
    613617        } 
    614618 
    615         add_link(req, 'up', get_resource_url(self.env, parent, req.href), 
    616                  get_resource_name(self.env, parent)) 
    617  
    618619        return 'attachment.html', data, None 
    619620 
    620621    def _render_view(self, req, attachment): 
    621622        req.perm(attachment.resource).require('ATTACHMENT_VIEW') 
    622         req.check_modified(attachment.date) 
     623        can_delete = 'ATTACHMENT_DELETE' in req.perm(attachment.resource) 
     624        req.check_modified(attachment.date, str(can_delete)) 
    623625 
    624626        data = {'mode': 'view', 
  • branches/trac.upstream-r6669/trac/db/mysql_backend.py

    r46 r52  
    1 # -*- coding: iso8859-1 -*- 
     1# -*- coding: utf-8 -*- 
    22# 
    33# Copyright (C) 2005-2006 Edgewall Software 
     
    177177        if type == 'int': 
    178178            type = 'signed' 
     179        elif type == 'text': 
     180            type = 'char' 
    179181        return 'CAST(%s AS %s)' % (column, type) 
    180182 
  • branches/trac.upstream-r6669/trac/htdocs/css/about.css

    r46 r52  
    1414  padding: 3px; 
    1515} 
    16 #content.about #config td.value { font-family: monospace; } 
    17 #content.about #config tr.modified { background: #fee; } 
    18 #content.about #config tr.modified td.value { font-weight: bold; } 
     16#content.about #config tr.modified { background: #ffd; } 
     17#content.about #config tr.modified td.value { font-style: italic; } 
    1918#content.about #config td.doc { padding: 3px 1em; } 
  • branches/trac.upstream-r6669/trac/htdocs/css/report.css

    r46 r52  
    2121#query fieldset, #query fieldset input, #query fieldset select { font-size: 11px } 
    2222#query fieldset { margin-top: 1em } 
    23 #query fieldset.collapsed { border-width: 0 } 
     23#query fieldset.collapsed {  
     24 border-width: 0; 
     25 margin-bottom: 0pt; 
     26 padding: 0pt .5em; 
     27
    2428#query .option, #query .option input, #query .option select { font-size: 11px } 
    2529#query .option { float: left; line-height: 2em; margin: .9em 2.5em 0 .5em; padding: 0 0 .1em } 
  • branches/trac.upstream-r6669/trac/htdocs/js/blame.js

    r46 r52  
    7979 
    8080            // workaround non-clickable "Close" issue in Firefox 
    81             if ($.browser == 'mozilla'
     81            if ($.browser.mozilla
    8282              message.find("div.inlinebuttons").next().css("clear", "right"); 
    8383   
  • branches/trac.upstream-r6669/trac/htdocs/js/query.js

    r46 r52  
    134134      // Convenience function for creating an <input type="radio"> 
    135135      function createRadio(name, value, id) { 
    136         var input = document.createElement("input"); 
    137         input.type = "radio"; 
    138         if (name) input.name = name; 
    139         if (value) input.value = value; 
    140         if (id) input.id = id; 
    141         return input; 
     136        var str = '<input type="radio"'; 
     137        if (name) str += ' name="' + name + '"'; 
     138        if (value) str += ' value="' + value + '"'; 
     139        if (id) str += ' id="' + id + '"';  
     140        str += '/>'; 
     141        var span = document.createElement('span'); 
     142        // create radio button with innerHTML to avoid IE mangling it. 
     143        span.innerHTML = str;  
     144        return span; 
    142145      } 
    143146   
  • branches/trac.upstream-r6669/trac/mimeview/rst.py

    r46 r52  
    2727from distutils.version import StrictVersion 
    2828import re 
     29try: 
     30    from docutils import nodes 
     31    from docutils.core import publish_parts 
     32    from docutils.parsers import rst 
     33    from docutils import __version__ 
     34    has_docutils = True 
     35except ImportError: 
     36    has_docutils = False 
    2937 
    3038from trac.core import * 
     
    4856 
    4957    def render(self, context, mimetype, content, filename=None, rev=None): 
    50         try: 
    51             from docutils import nodes 
    52             from docutils.core import publish_parts 
    53             from docutils.parsers import rst 
    54             from docutils import __version__ 
    55         except ImportError: 
     58        global has_docutils 
     59        if not has_docutils: 
    5660            raise TracError(_('Docutils not found')) 
    5761        if StrictVersion(__version__) < StrictVersion('0.3.9'): 
  • branches/trac.upstream-r6669/trac/resource.py

    r46 r52  
    105105            if r.id: 
    106106                name += ':' + unicode(r.id) # id can be numerical 
    107             if r.version
     107            if r.version is not None
    108108                name += '@' + unicode(r.version) 
    109109            path.append(name) 
     
    149149        "<Resource u'wiki:WikiStart@3'>" 
    150150 
     151        >>> main0 = main3(version=0) 
     152        >>> repr(main0) 
     153        "<Resource u'wiki:WikiStart@0'>" 
     154 
    151155        In a copy, if `id` is overriden, then the original `version` value 
    152156        will not be reused. 
     
    160164        realm = resource_or_realm 
    161165        if isinstance(resource_or_realm, Resource): 
    162             if (id, version, parent) == (False, False, False)
     166            if id is False and version is False and parent is False
    163167                return resource_or_realm 
    164168            else: # copy and override 
  • branches/trac.upstream-r6669/trac/templates/layout.html

    r46 r52  
    3939    <div id="banner"> 
    4040      <div id="header" py:choose=""> 
    41         <a py:when="chrome.logo.src" id="logo" href="${chrome.logo.link}"><img 
     41        <a py:when="chrome.logo.src" id="logo" href="${chrome.logo.link or href.wiki('TracIni')+'#header_logo-section'}"><img 
    4242          src="${chrome.logo.src}" alt="${chrome.logo.alt}" 
    4343          height="${chrome.logo.height or None}" width="${chrome.logo.width or None}" /></a> 
     
    9090      <script type="text/javascript" py:if="chrome.late_links"> 
    9191        <py:for each="link in chrome.late_links.get('stylesheet')"> 
    92           $.loadStyleSheet("${link.href}", "${link.title}"); 
     92          jQuery.loadStyleSheet("${link.href}", "${link.title}"); 
    9393        </py:for> 
    9494      </script> 
  • branches/trac.upstream-r6669/trac/test.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/trac/tests/config.py

    r46 r52  
    212212        config = self._read() 
    213213        self.assertEquals('x', config.get('a', 'option')) 
    214         time.sleep(1) # needed because of low mtime granularity 
     214        time.sleep(2) # needed because of low mtime granularity, 
     215                      # especially on fat filesystems 
    215216 
    216217        self._write(['[a]', 'option = y']) 
  • branches/trac.upstream-r6669/trac/ticket/admin.py

    r46 r52  
    114114                              in self.env.get_known_users() 
    115115                              if valid_owner(username)] 
     116            data['owners'].insert(0, '') 
     117            data['owners'].sort() 
    116118        else: 
    117119            data['owners'] = None 
  • branches/trac.upstream-r6669/trac/ticket/default_workflow.py

    r46 r52  
    216216        hints = [] 
    217217        if 'reset_workflow' in operations: 
    218             control.append(tag("from invalid state")) 
     218            control.append(tag("from invalid state ")) 
    219219            hints.append(_("Current state no longer exists")) 
    220220        if 'del_owner' in operations: 
     
    240240                hints.append(_("The owner will change")) 
    241241            elif len(owners) == 1: 
    242                 control.append(tag('to %s' % owners[0])) 
     242                control.append(tag('to %s ' % owners[0])) 
    243243                hints.append(_("The owner will change to %s") % owners[0]) 
    244244            else: 
     
    272272                hints.append(_("The resolution will be set")) 
    273273        if 'leave_status' in operations: 
    274             control.append('as ' + ticket['status']) 
     274            control.append('as %s ' % ticket['status']) 
    275275        else: 
    276276            if status != '*': 
  • branches/trac.upstream-r6669/trac/ticket/model.py

    r46 r52  
    613613            raise ResourceNotFound('Milestone %s does not exist.' % name, 
    614614                                   'Invalid Milestone Name') 
     615        self._from_database(row) 
     616 
     617    exists = property(fget=lambda self: self._old_name is not None) 
     618    is_completed = property(fget=lambda self: self.completed is not None) 
     619    is_late = property(fget=lambda self: self.due and \ 
     620                                         self.due.date() < date.today()) 
     621 
     622    def _from_database(self, row): 
    615623        name, due, completed, description = row 
    616         self.name = name 
     624        self.name = self._old_name = name 
    617625        self.due = due and datetime.fromtimestamp(int(due), utc) or None 
    618626        self.completed = completed and \ 
    619627                         datetime.fromtimestamp(int(completed), utc) or None 
    620628        self.description = description or '' 
    621  
    622     exists = property(fget=lambda self: self._old_name is not None) 
    623     is_completed = property(fget=lambda self: self.completed is not None) 
    624     is_late = property(fget=lambda self: self.due and \ 
    625                                          self.due.date() < date.today()) 
    626629 
    627630    def delete(self, retarget_to=None, author=None, db=None): 
     
    702705        cursor.execute(sql) 
    703706        milestones = [] 
    704         for name,due,completed,description in cursor: 
     707        for row in cursor: 
    705708            milestone = Milestone(env) 
    706             milestone.name = milestone._old_name = name 
    707             milestone.due = due and datetime.fromtimestamp(int(due), utc) or None 
    708             if completed: 
    709                 milestone.completed = datetime.fromtimestamp(int(completed), utc) 
    710             else: 
    711                 milestone.completed = None 
    712             milestone.description = description or '' 
     709            milestone._from_database(row) 
    713710            milestones.append(milestone) 
    714711        def milestone_order(m): 
  • branches/trac.upstream-r6669/trac/ticket/templates/ticket_notify_email.txt

    r46 r52  
    2929--  
    3030Ticket URL: <$ticket.link> 
    31 $project.name <${abs_href()}> 
     31$project.name <${project.url or abs_href()}> 
    3232$project.descr 
  • branches/trac.upstream-r6669/trac/ticket/web_ui.py

    r46 r52  
    179179        sql, args = search_to_sql(db, ['b.newvalue'], terms) 
    180180        sql2, args2 = search_to_sql(db, ['summary', 'keywords', 'description', 
    181                                          'reporter', 'cc', 'id'], terms) 
     181                                         'reporter', 'cc',  
     182                                         db.cast('id', 'text')], terms) 
    182183        cursor = db.cursor() 
    183184        cursor.execute("SELECT DISTINCT a.summary,a.description,a.reporter, " 
     
    413414                                         'view')) 
    414415 
    415         data = {'ticket': ticket, 'comment': None} 
    416416        data = self._prepare_data(req, ticket) 
    417417        data['comment'] = None 
  • branches/trac.upstream-r6669/trac/util/compat.py

    r46 r52  
    6666        return _getitem 
    6767 
     68class py_groupby(object): 
     69    def __init__(self, iterable, key=None): 
     70        if key is None: 
     71            key = lambda x: x 
     72        self.keyfunc = key 
     73        self.it = iter(iterable) 
     74        self.tgtkey = self.currkey = self.currvalue = xrange(0) 
     75    def __iter__(self): 
     76        return self 
     77    def next(self): 
     78        while self.currkey == self.tgtkey: 
     79            self.currvalue = self.it.next() # Exit on StopIteration 
     80            self.currkey = self.keyfunc(self.currvalue) 
     81        self.tgtkey = self.currkey 
     82        return (self.currkey, self._grouper(self.tgtkey)) 
     83    def _grouper(self, tgtkey): 
     84        while self.currkey == tgtkey: 
     85            yield self.currvalue 
     86            self.currvalue = self.it.next() # Exit on StopIteration 
     87            self.currkey = self.keyfunc(self.currvalue) 
    6888try: 
    6989    from itertools import groupby 
    7090except ImportError: 
    71     class groupby(object): 
    72         def __init__(self, iterable, key=None): 
    73             if key is None: 
    74                 key = lambda x: x 
    75             self.keyfunc = key 
    76             self.it = iter(iterable) 
    77             self.tgtkey = self.currkey = self.currvalue = xrange(0) 
    78         def __iter__(self): 
    79             return self 
    80         def next(self): 
    81             while self.currkey == self.tgtkey: 
    82                 self.currvalue = self.it.next() # Exit on StopIteration 
    83                 self.currkey = self.keyfunc(self.currvalue) 
    84             self.tgtkey = self.currkey 
    85             return (self.currkey, self._grouper(self.tgtkey)) 
    86         def _grouper(self, tgtkey): 
    87             while self.currkey == tgtkey: 
    88                 yield self.currvalue 
    89                 self.currvalue = self.it.next() # Exit on StopIteration 
    90                 self.currkey = self.keyfunc(self.currvalue) 
     91    groupby = py_groupby 
    9192 
    9293try: 
  • branches/trac.upstream-r6669/trac/util/datefmt.py

    r46 r52  
    8282    if resolution and age_s < resolution: 
    8383        return '' 
    84     if age_s < 60
     84    if age_s <= 60 * 1.9
    8585        return '%i second%s' % (age_s, age_s != 1 and 's' or '') 
    8686    for u, unit, unit_plural in units: 
    8787        r = float(age_s) / float(u) 
    88         if r >= 0.9: 
     88        if r >= 1.9: 
    8989            r = int(round(r)) 
    9090            return '%d %s' % (r, r == 1 and unit or unit_plural) 
  • branches/trac.upstream-r6669/trac/versioncontrol/web_ui/browser.py

    r46 r52  
    330330        order = req.args.get('order', None) 
    331331        desc = req.args.get('desc', None) 
     332        xhr = req.get_header('X-Requested-With') == 'XMLHttpRequest' 
    332333 
    333334        # Find node for the requested path/rev 
     
    355356            'created_path': node.created_path, 
    356357            'created_rev': node.created_rev, 
    357             'properties': self.render_properties('browser', context, 
    358                                                  node.get_properties()), 
     358            'properties': xhr or self.render_properties('browser', context, 
     359                                                        node.get_properties()), 
    359360            'path_links': path_links, 
    360361            'dir': node.isdir and self._render_dir(req, repos, node, rev), 
    361362            'file': node.isfile and self._render_file(req, context, repos, 
    362363                                                      node, rev), 
    363             'quickjump_entries': list(repos.get_quickjump_entries(rev)), 
     364            'quickjump_entries': xhr or list(repos.get_quickjump_entries(rev)), 
    364365            'wiki_format_messages': 
    365366            self.config['changeset'].getbool('wiki_format_messages') 
    366367        } 
     368        if xhr: # render and return the content only 
     369            data['xhr'] = True 
     370            return 'dir_entries.html', data, None 
     371 
     372        # Links for contextual navigation 
    367373        add_ctxtnav(req, tag.a(_('Last Change'),  
    368374                    href=req.href.changeset(node.rev, node.created_path))) 
     
    381387                                                  rev=node.rev, 
    382388                                                  annotate=1)) 
    383                  
    384389        add_ctxtnav(req, _('Revision Log'),  
    385390                    href=req.href.log(path, rev=rev)) 
    386391 
    387         xhr = req.get_header('X-Requested-With') == 'XMLHttpRequest' 
    388         if xhr: # render and return the content only 
    389             data['xhr'] = True 
    390             return 'dir_entries.html', data, None 
    391          
    392392        add_stylesheet(req, 'common/css/browser.css') 
    393393        return 'browser.html', data, None 
     
    399399 
    400400        # Entries metadata 
    401         entries = list(node.get_entries()) 
     401        class entry(object): 
     402            __slots__ = 'name rev kind isdir path content_length'.split() 
     403            def __init__(self, node): 
     404                for f in entry.__slots__: 
     405                    setattr(self, f, getattr(n, f)) 
     406                 
     407        entries = [entry(n) for n in node.get_entries()] 
    402408        changes = get_changes(repos, [i.rev for i in entries]) 
    403409 
  • branches/trac.upstream-r6669/trac/versioncontrol/web_ui/util.py

    r46 r52  
    3333    changes = {} 
    3434    for rev in revs: 
     35        if rev in changes: 
     36            continue 
    3537        try: 
    3638            changeset = repos.get_changeset(rev) 
  • branches/trac.upstream-r6669/trac/web/cgi_frontend.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/trac/web/chrome.py

    r46 r52  
    255255           listed by IDs. See also TracNavigation.""") 
    256256 
    257     logo_link = Option('header_logo', 'link', 'http://example.org/', 
     257    logo_link = Option('header_logo', 'link', '', 
    258258        """URL to link to from header logo.""") 
    259259 
    260     logo_src = Option('header_logo', 'src', 'common/trac_banner.png', 
     260    logo_src = Option('header_logo', 'src', 'site/your_project_logo.png', 
    261261        """URL of the image to use as header logo.""") 
    262262 
    263     logo_alt = Option('header_logo', 'alt', '', 
     263    logo_alt = Option('header_logo', 'alt',  
     264        "(please configure the [header_logo] section in trac.ini)", 
    264265        """Alternative text for the header logo.""") 
    265266 
     
    289290        'gettext': translation.gettext, 
    290291        'group': presentation.group, 
    291         'groupby': compat.groupby, 
     292        'groupby': compat.py_groupby, 
    292293        'http_date': http_date, 
    293294        'istext': presentation.istext, 
  • branches/trac.upstream-r6669/trac/web/fcgi_frontend.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/trac/web/standalone.py

    • Property svn:executable set to *
  • branches/trac.upstream-r6669/trac/wiki/macros.py

    r46 r52  
    3030from trac.util.compat import sorted, groupby, any, set 
    3131from trac.util.html import escape 
    32 from trac.util.text import unquote 
     32from trac.util.text import unquote, to_unicode 
    3333from trac.util.translation import _ 
    3434from trac.wiki.api import IWikiMacroProvider, WikiSystem, parse_args 
     
    5454    def get_macro_description(self, name): 
    5555        """Return the subclass's docstring.""" 
    56         return inspect.getdoc(self.__class__
     56        return to_unicode(inspect.getdoc(self.__class__)
    5757 
    5858    def parse_macro(self, parser, name, content): 

SFLC Main Page

[frdm] Support SFLC