~ubuntu-branches/ubuntu/vivid/kate/vivid-updates

« back to all changes in this revision

Viewing changes to addons/kate/pate/src/plugins/python_utils/python_checkers/utils.py

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2014-12-04 16:49:41 UTC
  • mfrom: (1.6.6)
  • Revision ID: package-import@ubuntu.com-20141204164941-l3qbvsly83hhlw2v
Tags: 4:14.11.97-0ubuntu1
* New upstream release
* Update build-deps and use pkg-kde v3 for Qt 5 build
* kate-data now kate5-data for co-installability

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
# Copyright (c) 2013 by Pablo Martín <goinnn@gmail.com> and
3
 
# Alejandro Blanco <alejandro.b.e@gmail.com>
4
 
#
5
 
# This software is free software: you can redistribute it and/or modify
6
 
# it under the terms of the GNU Lesser General Public License as published by
7
 
# the Free Software Foundation, either version 3 of the License, or
8
 
# (at your option) any later version.
9
 
#
10
 
# This software is distributed in the hope that it will be useful,
11
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
# GNU Lesser General Public License for more details.
14
 
#
15
 
# You should have received a copy of the GNU Lesser General Public License
16
 
# along with this software.  If not, see <http://www.gnu.org/licenses/>.
17
 
 
18
 
 
19
 
def is_mymetype_python(doc, text_plain=False):
20
 
    mimetype = doc.mimeType()
21
 
    if mimetype == 'text/x-python':
22
 
        return True
23
 
    elif mimetype == 'text/plain' and text_plain:
24
 
        return True
25
 
    return False
26
 
 
27
 
 
28
 
def canCheckDocument(doc, text_plain=False):
29
 
    return not doc or (is_mymetype_python(doc, text_plain) and
30
 
                       not doc.isModified())
31
 
 
32
 
# kate: space-indent on; indent-width 4;