Skip to content

Commit

Permalink
Merge 4955268 into 9b3eb6b
Browse files Browse the repository at this point in the history
  • Loading branch information
delijati committed Oct 19, 2014
2 parents 9b3eb6b + 4955268 commit 0c7cf04
Show file tree
Hide file tree
Showing 45 changed files with 427 additions and 156 deletions.
20 changes: 20 additions & 0 deletions .gitignore
@@ -0,0 +1,20 @@
*.py[cod]
*.swp
__pycache__
.coverage
.installed.cfg
.mr.developer.cfg
bin/
plugins/
db/*
log/*
env3.4/
dist/
build/
*.egg-info/
.idea/
develop-eggs/
src/
doc/src
_html/
eggs/
9 changes: 8 additions & 1 deletion .hgtags
Expand Up @@ -4,11 +4,18 @@
27a222ccc739de48d114ae282f848aad27775904 SubversionImport
87ace7ce5663b6c662bcfa54818e099ffdcceb53 release_Yapsy-1.8
43a85ec50934b636dce6647eb5342b70b809ca20 release_Yapsy-1.9
ee9987b833d65887487af38cecf0eb9ed6b871eb release_Yapsy-1.9-python3
991a7a83265127a463c845fa56ada2183cdaafe3 release_Yapsy-1.10
991a7a83265127a463c845fa56ada2183cdaafe3 release_Yapsy-1.10
0000000000000000000000000000000000000000 release_Yapsy-1.10
0000000000000000000000000000000000000000 release_Yapsy-1.10
b934a474c2e8fa765bfda7bce134060184284872 release_Yapsy-1.10
a5c62d9f560fa44bbf41fdd0d2c9ddc85144f637 release_Yapsy-1.10.1
7000b8072f00e42d9c448092bbd2149cc76e8d21 release_Yapsy-1.10-python3
0000000000000000000000000000000000000000 release_Yapsy-1.10-python3
0000000000000000000000000000000000000000 release_Yapsy-1.10-python3
87fbef4ba66ba9f98692e9b657479fe5daae12a2 release_Yapsy-1.10-python3
f59fd5772939d6779725d0bb55b612ba5b254534 release_Yapsy-1.10.1-python3
5c0ff8646c2e1b6e0a4676b57676ed5adbe6b479 release_Yapsy-1.10.2
95b58ee3f7f4cd225caf8ff84bf5808fbf52279a release_Yapsy-1.10.323
c1f8228a9fd08bbffbfd8b6b8ecd1de5c2d9236f release_Yapsy-1.10.2-python3
777d3daf4648d8395be90a2059c749bca191cbcd release_Yapsy-1.10.323-python3
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,9 @@ language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"

# command to install dependencies
install:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -13,7 +13,7 @@ To get more details about the sources please look:

Yapsy's development is [hosted at Sourceforge](http://sourceforge.net/projects/yapsy/)

Yapsy is also continuously tested on [travis-ci](https://travis-ci.org):
Yapsy is also continuously tested on [travis-ci](https://travis-ci.org):

[![Build Status](https://travis-ci.org/tibonihoo/yapsy.png?branch=master)](https://travis-ci.org/tibonihoo/yapsy)
[![Coverage Status](https://coveralls.io/repos/tibonihoo/yapsy/badge.png?branch=master)](https://coveralls.io/r/tibonihoo/yapsy?branch=master)
[![Build Status](https://travis-ci.org/tibonihoo/yapsy.png?branch=python3)](https://travis-ci.org/tibonihoo/yapsy)
[![Coverage Status](https://coveralls.io/repos/tibonihoo/yapsy/badge.png?branch=python3)](https://coveralls.io/r/tibonihoo/yapsy?branch=python3)
2 changes: 2 additions & 0 deletions package/CHANGELOG.txt
Expand Up @@ -18,6 +18,8 @@ version-1.10.2 [2013-05-22]

- code: fix compatibility with python2.5
- doc: add links to travis-ci and readthedocs.org
- code: fix AutoInstall test failures [contrib. Agustin Henze]
- code: replace deprecated methods usage (for Python3)

version-1.10.1 [2013-01-13]

Expand Down
1 change: 1 addition & 0 deletions package/MANIFEST.in
@@ -1,6 +1,7 @@
include README.txt
include LICENSE.txt
include CHANGELOG.txt
include runtests.py

recursive-include test *.py *-plugin *.zip

Expand Down
2 changes: 1 addition & 1 deletion package/README.txt
Expand Up @@ -3,7 +3,7 @@ build a plugin system into a wider application.

The main purpose is to depend only on Python's standard libraries and
to implement only the basic functionalities needed to detect, load and
keep track of several plugins. It supports both Python 2 and 3.
keep track of several plugins.

To use yapsy, make sure that the "yapsy" directory is in your Python
loading path and just import the needed class from yapsy (e.g. "from
Expand Down
1 change: 1 addition & 0 deletions package/TODO.txt
Expand Up @@ -4,6 +4,7 @@

Next Release

- follow evolutions from default branch

Later

Expand Down
8 changes: 4 additions & 4 deletions package/doc/conf.py
Expand Up @@ -40,8 +40,8 @@
master_doc = 'index'

# General information about the project.
project = u'Yapsy'
copyright = u'2010-2014, Thibauld Nion'
project = 'Yapsy'
copyright = '2010-2014, Thibauld Nion'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -187,8 +187,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Yapsy.tex', u'Yapsy Documentation',
u'Thibauld Nion', 'manual'),
('index', 'Yapsy.tex', 'Yapsy Documentation',
'Thibauld Nion', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
6 changes: 3 additions & 3 deletions package/test/main.py → package/runtests.py
Expand Up @@ -12,7 +12,7 @@
import logging


from test_All import MainTestSuite
from test.test_All import MainTestSuite

def usage():
"""
Expand All @@ -37,13 +37,13 @@ def main(argv):
try:
opts, args = getopt.getopt(argv[1:], "vdh", ["help"])
except getopt.GetoptError:
print usage()
print(usage())
sys.exit(2)
loglevel = logging.ERROR
test_verbosity = 1
for o,a in opts:
if o in ("-h","--help"):
print usage()
print(usage())
sys.exit(0)
elif o == "-d":
loglevel = logging.DEBUG
Expand Down
1 change: 1 addition & 0 deletions package/setup.py
Expand Up @@ -59,6 +59,7 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules'],
platforms='All',
)
Expand Down
2 changes: 0 additions & 2 deletions package/test/plugins/ConfigPlugin.py
Expand Up @@ -7,8 +7,6 @@
This is certainly the second simplest plugin ever.
"""

import test_settings
import main
from yapsy.IPlugin import IPlugin

class ConfigPlugin(IPlugin):
Expand Down
2 changes: 0 additions & 2 deletions package/test/plugins/ErroneousPlugin.py
Expand Up @@ -7,8 +7,6 @@
This is certainly the second simplest plugin ever.
"""

import test_settings
import main
from yapsy.IPlugin import IPlugin

from import_error import the_error_is_here
Expand Down
2 changes: 0 additions & 2 deletions package/test/plugins/SimplePlugin.py
Expand Up @@ -7,8 +7,6 @@
This is certainly the second simplest plugin ever.
"""

import test_settings
import main
from yapsy.IPlugin import IPlugin

class SimplePlugin(IPlugin):
Expand Down
3 changes: 1 addition & 2 deletions package/test/plugins/VersionedPlugin10.py
Expand Up @@ -7,8 +7,7 @@
This is certainly the second simplest plugin ever.
"""

from test_settings import *
import main
from test_settings import TEST_MESSAGE
from yapsy.IPlugin import IPlugin

class VersionedPlugin10(IPlugin):
Expand Down
3 changes: 1 addition & 2 deletions package/test/plugins/VersionedPlugin11.py
Expand Up @@ -7,8 +7,7 @@
This is certainly the second simplest plugin ever.
"""

from test_settings import *
import main
from test_settings import TEST_MESSAGE
from yapsy.IPlugin import IPlugin

class VersionedPlugin11(IPlugin):
Expand Down
3 changes: 1 addition & 2 deletions package/test/plugins/VersionedPlugin111.py
Expand Up @@ -7,8 +7,7 @@
This is certainly the second simplest plugin ever.
"""

from test_settings import *
import main
from test_settings import TEST_MESSAGE
from yapsy.IPlugin import IPlugin

class VersionedPlugin111(IPlugin):
Expand Down
3 changes: 1 addition & 2 deletions package/test/plugins/VersionedPlugin12.py
Expand Up @@ -7,8 +7,7 @@
This is certainly the second simplest plugin ever.
"""

from test_settings import *
import main
from test_settings import TEST_MESSAGE
from yapsy.IPlugin import IPlugin

class VersionedPlugin12(IPlugin):
Expand Down
3 changes: 1 addition & 2 deletions package/test/plugins/VersionedPlugin12a1.py
Expand Up @@ -7,8 +7,7 @@
This is certainly the second simplest plugin ever.
"""

from test_settings import *
import main
from test_settings import TEST_MESSAGE
from yapsy.IPlugin import IPlugin

class VersionedPlugin12a1(IPlugin):
Expand Down
3 changes: 0 additions & 3 deletions package/test/pluginsasdirs/SimplePlugin/__init__.py
Expand Up @@ -2,13 +2,10 @@
# -*- coding: utf-8 -*-



"""
This is certainly the second simplest plugin ever.
"""

import test_settings
import main
from yapsy.IPlugin import IPlugin

class SimplePlugin(IPlugin):
Expand Down
2 changes: 0 additions & 2 deletions package/test/pluginstoinstall/AutoInstallPlugin.py
Expand Up @@ -7,8 +7,6 @@
This is certainly the second simplest plugin ever.
"""

import test_settings
import main
from yapsy.IPlugin import IPlugin

class AutoInstallPlugin(IPlugin):
Expand Down
Binary file modified package/test/pluginstoinstall/autoinstallWRONGzipplugin.zip
Binary file not shown.
Binary file modified package/test/pluginstoinstall/autoinstallZIPplugin.zip
Binary file not shown.
Expand Up @@ -7,8 +7,6 @@
This is certainly the second simplest plugin ever.
"""

import test_settings
import main
from yapsy.IPlugin import IPlugin

class AutoInstallDirPlugin(IPlugin):
Expand Down
18 changes: 9 additions & 9 deletions package/test/test_All.py
Expand Up @@ -16,15 +16,15 @@


# load the tests
import test_SimplePlugin
import test_Singleton
import test_ConfigPlugin
import test_VersionedPlugin
import test_AutoInstallPlugin
import test_FilterPlugin
import test_ErrorInPlugin
import test_PluginFileLocator
import test_PluginInfo
from . import test_SimplePlugin
from . import test_Singleton
from . import test_ConfigPlugin
from . import test_VersionedPlugin
from . import test_AutoInstallPlugin
from . import test_FilterPlugin
from . import test_ErrorInPlugin
from . import test_PluginFileLocator
from . import test_PluginInfo


# add them to a common test suite
Expand Down
37 changes: 14 additions & 23 deletions package/test/test_AutoInstallPlugin.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*-

import test_settings
from . import test_settings
import unittest
import sys
import os
Expand Down Expand Up @@ -86,7 +86,7 @@ def plugin_loading_check(self,new_plugin_name):
self.assertEqual(self.plugin_info.name,new_plugin_name)
self.assertEqual(sole_category,self.plugin_info.category)
else:
self.assert_(True)
self.assertTrue(True)

def testGetSetInstallDir(self):
"""
Expand All @@ -109,7 +109,7 @@ def testInstallFile(self):
"""
install_success = self.pluginManager.install(self.new_plugins_waiting_dir,
"autoinstallplugin.yapsy-autoinstall-plugin")
self.assert_(install_success)
self.assertTrue(install_success)
self.pluginManager.collectPlugins()
self.plugin_loading_check("Auto Install Plugin")

Expand All @@ -120,7 +120,7 @@ def testInstallDir(self):
"""
install_success = self.pluginManager.install(self.new_plugins_waiting_dir,
"autoinstalldirplugin.yapsy-autoinstall-plugin")
self.assert_(install_success)
self.assertTrue(install_success)
self.pluginManager.collectPlugins()
self.plugin_loading_check("Auto Install Dir Plugin")

Expand All @@ -131,16 +131,16 @@ def testActivationAndDeactivation(self):
"""
install_success = self.pluginManager.install(self.new_plugins_waiting_dir,
"autoinstallplugin.yapsy-autoinstall-plugin")
self.assert_(install_success)
self.assertTrue(install_success)
self.pluginManager.collectPlugins()
self.plugin_loading_check("Auto Install Plugin")
self.assert_(not self.plugin_info.plugin_object.is_activated)
self.assertTrue(not self.plugin_info.plugin_object.is_activated)
self.pluginManager.activatePluginByName(self.plugin_info.name,
self.plugin_info.category)
self.assert_(self.plugin_info.plugin_object.is_activated)
self.assertTrue(self.plugin_info.plugin_object.is_activated)
self.pluginManager.deactivatePluginByName(self.plugin_info.name,
self.plugin_info.category)
self.assert_(not self.plugin_info.plugin_object.is_activated)
self.assertTrue(not self.plugin_info.plugin_object.is_activated)

class AutoInstallZIPTestsCase(unittest.TestCase):
"""
Expand Down Expand Up @@ -208,7 +208,7 @@ def plugin_loading_check(self,new_plugin_name):
self.assertEqual(self.plugin_info.name,new_plugin_name)
self.assertEqual(sole_category,self.plugin_info.category)
else:
self.assert_(True)
self.assertTrue(True)

def testNoneLoaded(self):
"""
Expand All @@ -221,11 +221,8 @@ def testInstallZIP(self):
Test if the correct plugin (define by a zip file) can be installed and loaded.
"""
test_file = os.path.join(self.new_plugins_waiting_dir,"autoinstallZIPplugin.zip")
if sys.version_info < (2, 6):
self.assertRaises(NotImplementedError,self.pluginManager.installFromZIP,test_file)
return
install_success = self.pluginManager.installFromZIP(test_file)
self.assert_(install_success)
self.assertTrue(install_success)
self.pluginManager.collectPlugins()
self.plugin_loading_check("Auto Install ZIP Plugin")

Expand All @@ -234,9 +231,6 @@ def testInstallZIPFailOnWrongZip(self):
Test if, when the zip file does not contain what is required the installation fails.
"""
test_file = os.path.join(self.new_plugins_waiting_dir,"autoinstallWRONGzipplugin.zip")
if sys.version_info < (2, 6):
self.assertRaises(NotImplementedError,self.pluginManager.installFromZIP,test_file)
return
install_success = self.pluginManager.installFromZIP(test_file)
self.assertFalse(install_success)
self.pluginManager.collectPlugins()
Expand Down Expand Up @@ -273,20 +267,17 @@ def testActivationAndDeactivation(self):
Test if the activation procedure works.
"""
test_file = os.path.join(self.new_plugins_waiting_dir,"autoinstallZIPplugin.zip")
if sys.version_info < (2, 6):
self.assertRaises(NotImplementedError,self.pluginManager.installFromZIP,test_file)
return
install_success = self.pluginManager.installFromZIP(test_file)
self.assert_(install_success)
self.assertTrue(install_success)
self.pluginManager.collectPlugins()
self.plugin_loading_check("Auto Install ZIP Plugin")
self.assert_(not self.plugin_info.plugin_object.is_activated)
self.assertTrue(not self.plugin_info.plugin_object.is_activated)
self.pluginManager.activatePluginByName(self.plugin_info.name,
self.plugin_info.category)
self.assert_(self.plugin_info.plugin_object.is_activated)
self.assertTrue(self.plugin_info.plugin_object.is_activated)
self.pluginManager.deactivatePluginByName(self.plugin_info.name,
self.plugin_info.category)
self.assert_(not self.plugin_info.plugin_object.is_activated)
self.assertTrue(not self.plugin_info.plugin_object.is_activated)



Expand Down

0 comments on commit 0c7cf04

Please sign in to comment.