• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hivesolutions / colony-plugins / 1474

pending completion
1474

push

travis-ci-com

joamag
feat: new binaries

41245 of 79069 relevant lines covered (52.16%)

2.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.86
/format/src/mime_utils_plugin.py
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3

4
# Hive Colony Framework
5
# Copyright (c) 2008-2020 Hive Solutions Lda.
6
#
7
# This file is part of Hive Colony Framework.
8
#
9
# Hive Colony Framework is free software: you can redistribute it and/or modify
10
# it under the terms of the Apache License as published by the Apache
11
# Foundation, either version 2.0 of the License, or (at your option) any
12
# later version.
13
#
14
# Hive Colony Framework is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# Apache License for more details.
18
#
19
# You should have received a copy of the Apache License along with
20
# Hive Colony Framework. If not, see <http://www.apache.org/licenses/>.
21

22
__author__ = "João Magalhães <joamag@hive.pt>"
11✔
23
""" The author(s) of the module """
24

25
__version__ = "1.0.0"
11✔
26
""" The version of the module """
27

28
__revision__ = "$LastChangedRevision$"
11✔
29
""" The revision number of the module """
30

31
__date__ = "$LastChangedDate$"
11✔
32
""" The last change date of the module """
33

34
__copyright__ = "Copyright (c) 2008-2020 Hive Solutions Lda."
11✔
35
""" The copyright for the module """
36

37
__license__ = "Apache License, Version 2.0"
11✔
38
""" The license for the module """
39

40
import colony
11✔
41

42
class MimeUtilsPlugin(colony.Plugin):
11✔
43
    """
44
    The main class for the Mime Format Utils plugin.
45
    """
46

47
    id = "pt.hive.colony.plugins.format.mime.utils"
11✔
48
    name = "Mime Format Utils"
11✔
49
    description = "The plugin that offers the mime format utils support"
11✔
50
    version = "1.0.0"
11✔
51
    author = "Hive Solutions Lda. <development@hive.pt>"
11✔
52
    platforms = [
11✔
53
        colony.CPYTHON_ENVIRONMENT,
54
        colony.JYTHON_ENVIRONMENT,
55
        colony.IRON_PYTHON_ENVIRONMENT
56
    ]
57
    capabilities = [
11✔
58
        "format.mime.utils"
59
    ]
60
    dependencies = [
11✔
61
        colony.PluginDependency("pt.hive.colony.plugins.format.mime")
62
    ]
63
    main_modules = [
11✔
64
        "mime_utils_c"
65
    ]
66

67
    def load_plugin(self):
11✔
68
        colony.Plugin.load_plugin(self)
×
69
        import mime_utils_c
×
70
        self.system = mime_utils_c.MimeUtils(self)
×
71

72
    def add_attachment_contents(self, mime_message, contents, file_name):
11✔
73
        return self.system.add_attachment_contents(mime_message, contents, file_name)
×
74

75
    def add_attachment_contents_mime_type(self, mime_message, contents, file_name, mime_type):
11✔
76
        return self.system.add_attachment_contents(mime_message, contents, file_name, mime_type)
×
77

78
    def add_contents(self, mime_message, contents_path, content_extensions):
11✔
79
        return self.system.add_contents(mime_message, contents_path, content_extensions)
×
80

81
    def add_contents_non_recursive(self, mime_message, contents_path, content_extensions):
11✔
82
        return self.system.add_contents(mime_message, contents_path, content_extensions, False)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc