web2py / web2py

@@ -171,6 +171,10 @@
Loading
171 171
        text = to_native(text[:length - len(dots)]) + dots
172 172
    return text
173 173
174 +
class SafeString(str):
175 +
    """ A string know to be safe that does not need to be escaped """
176 +
    def xml(self):
177 +
        return self
174 178
175 179
def URL(a=None,
176 180
        c=None,
@@ -415,7 +419,7 @@
Loading
415 419
416 420
    url = url_out(r, env, application, controller, function,
417 421
                  args, other, scheme, host, port, language=language)
418 -
    return url
422 +
    return SafeString(url)
419 423
420 424
421 425
def verifyURL(request, hmac_key=None, hash_vars=True, salt=None, user_signature=None, hash_extension=True):

@@ -262,15 +262,13 @@
Loading
262 262
                if filename is None:
263 263
                    raise Exception('Missing attachment name')
264 264
                payload = payload.read()
265 -
            # FIXME PY3 can be used to_native?
266 -
            filename = filename.encode(encoding)
267 265
            if content_type is None:
268 266
                content_type = contenttype(filename)
269 267
            self.my_filename = filename
270 268
            self.my_payload = payload
271 269
            MIMEBase.__init__(self, *content_type.split('/', 1))
272 270
            self.set_payload(payload)
273 -
            self['Content-Disposition'] = Header('attachment; filename="%s"' % to_native(filename, encoding), 'utf-8')
271 +
            self.add_header('Content-Disposition', 'attachment', filename=filename)
274 272
            if content_id is not None:
275 273
                self['Content-Id'] = '<%s>' % to_native(content_id, encoding)
276 274
            Encoders.encode_base64(self)

@@ -84,7 +84,7 @@
Loading
84 84
        #  pathological backtracking from nested patterns.
85 85
        #
86 86
        file_match=r"([+=@$%\w-]|(?<=[+=@$%\w-])[./])*$",  # legal static subpath
87 -
        args_match=r"([\w@ =-]|(?<=[\w@ -])\.)*$",
87 +
        args_match=r"([\w@ =-]|(?<=[\w@ =-])\.)*$",
88 88
    )
89 89
    return router
90 90
Files Coverage
gluon 41.69%
Project Totals (45 files) 41.69%
ukk12vrb3g575mgk
iyktvwf278p14g5m
fkqi943s01qrp10q
1
codecov:
2
  branch: master
3

4
coverage:
5
  precision: 2
6
  round: down
7
  range: "70...100"
8

9
  status:
10
    changes: false
11

12
comment:
13
  layout: "header, diff, changes"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading