Commits

dan mackinlay  committed a99db78 Merge

merge upstream

  • Participants
  • Parent commits b1659d7, 911e7a4

Comments (0)

Files changed (11)

 6a979e1d29e5a490d418e21974ef7625fbe9c4ef seqdiag-0.2.3
 6a979e1d29e5a490d418e21974ef7625fbe9c4ef nwdiag-0.2.3
 6a979e1d29e5a490d418e21974ef7625fbe9c4ef actdiag-0.2.3
+54812ae19666b021774de8e87444eb62d4ff0530 doxylink-1.2

File doxylink/CHANGES.rst

+1.2 (Nov 3, 2011)
+====================
+
+- Add Python 3 support
+
 1.1 (Feb 19, 2011)
 ====================
 

File doxylink/doc/conf.py

 # built documents.
 #
 # The short X.Y version.
-version = '1.0'
+version = '1.2'
 # The full version, including alpha/beta/rc tags.
-release = '1.1'
+release = '1.2'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File doxylink/doc/index.rst

 	
 	Parallelise the calls to normalise() in parse_tag_file() using multiprocessing. Set up a pool of processes and pass in a queue of strings. Non-function calls will be done in the same way as present. For function calls, build up the information into a list of tuples, convert it into an appropriate Queue format and run it. Maybe even a multiprocessing.Pool.map could do the job. 
 
-:copyright: Copyright 2010 by Matt Williams
+:copyright: Copyright 2011 by Matt Williams
 :license: BSD, see LICENSE for details.
 

File doxylink/setup.py

 
 setup(
     name='sphinxcontrib-doxylink',
-    version='1.1',
+    version='1.2',
 	url='http://packages.python.org/sphinxcontrib-doxylink',
     download_url='http://pypi.python.org/pypi/sphinxcontrib-doxylink',
     license='BSD',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: BSD License',
         'Operating System :: OS Independent',
-        'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 3',
         'Topic :: Documentation',
         'Topic :: Utilities',
     ],
     include_package_data=True,
     install_requires=requires,
     namespace_packages=['sphinxcontrib'],
+	test_suite="tests",
+	use_2to3=True,
 )

File doxylink/sphinxcontrib/doxylink/parsing.py

 		arglist_input_string = arglist_input_string[:closing_bracket_location+1]
 	except ValueError:
 		#This shouldn't happen.
-		print('Could not find closing bracket in %s' % arglist_input_string)
+		print 'Could not find closing bracket in %s' % arglist_input_string
 		raise
 	
 	try:

File doxylink/test/__init__.py

Empty file removed.

File doxylink/test/test_parser.py

-import unittest
-
-from sphinxcontrib.doxylink import parsing
-   
-import pstats
-
-#List of tuples of: (input, correct output)
-#Input is a string, output is a tuple.
-arglists = [('( QUrl source )', ('', '(QUrl)')),
-            ('( QUrl * source )', ('', '(QUrl*)')),
-            ('( QUrl ** source )', ('', '(QUrl**)')),
-            ('( const QUrl ** source )', ('', '(const QUrl**)')),
-            ('( const QUrl source )', ('', '(const QUrl)')),
-            ('( QUrl & source )', ('', '(QUrl&)')),
-            ('( const QUrl & source )', ('', '(const QUrl&)')),
-            ('( const QUrl * source )', ('', '(const QUrl*)')),
-            ('( const QUrl const * source )', ('', '(const QUrl const *)')),
-            ('( const QByteArray & data, const QUrl & documentUri = QUrl() )', ('', '(const QByteArray&, const QUrl&)')),
-            ('(void)', ('', '(void)')),
-            ('(uint32_t uNoOfBlocksToProcess=(std::numeric_limits< uint32_t >::max)())', ('', '(uint32_t)')),
-            ('( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0 )', ('', '(QWidget*, const char*, Qt::WindowFlags)')),
-            ('()', ('', '()')),
-            ('( int index = 0 )', ('', '(int)')),
-            ('( bool ascending = true )', ('', '(bool)')),
-            ('( const QIcon & icon, const QString & label, int width = -1 )', ('', '(const QIcon&, const QString&, int)')),
-            ('( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = Qt::WType_TopLevel )', ('', '(QWidget*, const char*, Qt::WindowFlags)')),
-            ('( QMutex * mutex, unsigned long time = ULONG_MAX )', ('', '(QMutex*, unsigned long)')),
-            ('(const VolumeSampler< VoxelType > &volIter)', ('', '(const VolumeSampler< VoxelType >&)')),
-            ('(VolumeSampler< VoxelType > &volIter)', ('', '(VolumeSampler< VoxelType >&)')),
-            ('(const VolumeSampler< VoxelType > &volIter)', ('', '(const VolumeSampler< VoxelType >&)')),
-            ('(const uint32_t(&pDimensions)[noOfDims])', ('', '(const uint32_t)')),
-            ('(Array< noOfDims, ElementType > &rhs)', ('', '(Array< noOfDims, ElementType >&)')),
-            ('( const QString & path, const QString & nameFilter, SortFlags sort = SortFlags( Name | IgnoreCase ))', ('', '(const QString&, const QString&, SortFlags)')),
-            ('( GLuint texture_id )', ('', '(GLuint)')),
-            ('( Q3ValueList<T>::size_type i )', ('', '(Q3ValueList< T >::size_type)')),
-            ('(STLAllocator< T, P > const *, STLAllocator< T2, P > const &)', ('', '(STLAllocator< T, P > const *, STLAllocator< T2, P > const &)')),
-            ('(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)', ('', '(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)')),
-            ('(const String &errorMessage, String logName="")', ('', '(const String&, String)')),
-            ('(PixelFormat = PF_BYTE)', ('', '(PixelFormat)')),
-            ('(const SharedPtr< ControllerValue< T > > &src)', ('', '(const SharedPtr< ControllerValue < T > >&)')),
-            ('(typename T::iterator start, typename T::iterator last)', ('', '(typename T::iterator, typename T::iterator)')),
-            ('(const Matrix4 *const *blendMatrices)', ('', '(const Matrix4* const *)')),
-            ('(const Matrix4 *const *blendMatrices) const =0', ('', '(const Matrix4* const *) const')),
-]
-
-varargs = [('(int nb=0,...)', ('','(int, ...)')),
-]
-
-multiple_qualifiers = [('( QReadWriteLock * readWriteLock, unsigned long time = ULONG_MAX )', ('', '(QReadWriteLock*, unsigned long)')),
-]
-
-numbers_for_defaults = [('( const QPixmap & pixmap, const QString & text, int index = -1 )', ('', '(const QPixmap&, const QString&, int)')),
-                        ('( const char ** strings, int numStrings = -1, int index = -1 )', ('', '(const char**, int, int)')),
-                        ('( const QStringList & list, int index = -1 )', ('', '(const QStringList&, int)')),
-]
-
-flags_in_defaults = [('( const QString & text, int column, ComparisonFlags compare = ExactMatch | Qt::CaseSensitive )', ('', '(const QString&, int, ComparisonFlags)')),
-]
-
-functions = [('PolyVox::Volume::getDepth', ('PolyVox::Volume::getDepth', '')),
-             ('PolyVox::Volume::getDepth()', ('PolyVox::Volume::getDepth', '()')),
-             ('Volume::getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tDefault=VoxelType()) const', ('Volume::getVoxelAt', '(uint16_t, uint16_t, uint16_t, VoxelType) const')),
-             ('PolyVox::Array::operator[]', ('PolyVox::Array::operator[]', '')),
-             ('operator[]', ('operator[]', '')),
-]
-
-multiple_namespaces = [('PolyVox::Test::TestFunction(int foo)', ('PolyVox::Test::TestFunction', '(int)')),
-]
-
-class TestNormalise(unittest.TestCase):
-	def setUp(self):
-		self.arglists = arglists
-		self.functions = functions
-		self.varargs = varargs
-		self.multiple_qualifiers = multiple_qualifiers
-		self.numbers_for_defaults = numbers_for_defaults
-		self.flags_in_defaults = flags_in_defaults
-		self.multiple_namespaces = multiple_namespaces
-	
-	def test_split_function(self):
-		for function in self.functions:
-			self.assertEqual(parsing.normalise(function[0]), function[1])
-			
-	def test_normalise_arglist(self):
-		for arglist in self.arglists:
-			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
-			
-	def test_varargs(self):
-		for arglist in self.varargs:
-			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
-			
-	def test_multiple_qualifiers(self):
-		for arglist in self.multiple_qualifiers:
-			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
-			
-	def test_numbers_for_defaults(self):
-		for arglist in self.numbers_for_defaults:
-			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
-			
-	def test_flags_in_defaults(self):
-		for arglist in self.flags_in_defaults:
-			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
-			
-	def test_multiple_namespaces(self):
-		for arglist in self.multiple_namespaces:
-			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
-	
-	def test_false_signatures(self):
-		#This is an invalid function argument. Caused by a bug in Doxygen. See openbabel/src/ops.cpp : theOpCenter("center")
-		from pyparsing import ParseException
-		self.assertRaises(ParseException, parsing.normalise, '("center")')
-
-if __name__ == "__main__":
-	try:
-		import cProfile as profile
-	except ImportError:
-		import profile
-	
-	all_tests = arglists + varargs + multiple_qualifiers + functions + numbers_for_defaults + flags_in_defaults
-	all_tests += all_tests + all_tests + all_tests + all_tests
-	
-	profile.runctx("for arglist in all_tests: parsing.normalise(arglist[0])", globals(), locals(), filename='parsing_profile')
-	p = pstats.Stats('parsing_profile')
-	p.strip_dirs().sort_stats('time', 'cum').print_stats(40)
-
-

File doxylink/tests/__init__.py

Empty file added.

File doxylink/tests/test_parser.py

+import unittest
+
+from sphinxcontrib.doxylink import parsing
+   
+import pstats
+
+#List of tuples of: (input, correct output)
+#Input is a string, output is a tuple.
+arglists = [('( QUrl source )', ('', '(QUrl)')),
+            ('( QUrl * source )', ('', '(QUrl*)')),
+            ('( QUrl ** source )', ('', '(QUrl**)')),
+            ('( const QUrl ** source )', ('', '(const QUrl**)')),
+            ('( const QUrl source )', ('', '(const QUrl)')),
+            ('( QUrl & source )', ('', '(QUrl&)')),
+            ('( const QUrl & source )', ('', '(const QUrl&)')),
+            ('( const QUrl * source )', ('', '(const QUrl*)')),
+            ('( const QUrl const * source )', ('', '(const QUrl const *)')),
+            ('( const QByteArray & data, const QUrl & documentUri = QUrl() )', ('', '(const QByteArray&, const QUrl&)')),
+            ('(void)', ('', '(void)')),
+            ('(uint32_t uNoOfBlocksToProcess=(std::numeric_limits< uint32_t >::max)())', ('', '(uint32_t)')),
+            ('( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0 )', ('', '(QWidget*, const char*, Qt::WindowFlags)')),
+            ('()', ('', '()')),
+            ('( int index = 0 )', ('', '(int)')),
+            ('( bool ascending = true )', ('', '(bool)')),
+            ('( const QIcon & icon, const QString & label, int width = -1 )', ('', '(const QIcon&, const QString&, int)')),
+            ('( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = Qt::WType_TopLevel )', ('', '(QWidget*, const char*, Qt::WindowFlags)')),
+            ('( QMutex * mutex, unsigned long time = ULONG_MAX )', ('', '(QMutex*, unsigned long)')),
+            ('(const VolumeSampler< VoxelType > &volIter)', ('', '(const VolumeSampler< VoxelType >&)')),
+            ('(VolumeSampler< VoxelType > &volIter)', ('', '(VolumeSampler< VoxelType >&)')),
+            ('(const VolumeSampler< VoxelType > &volIter)', ('', '(const VolumeSampler< VoxelType >&)')),
+            ('(const uint32_t(&pDimensions)[noOfDims])', ('', '(const uint32_t)')),
+            ('(Array< noOfDims, ElementType > &rhs)', ('', '(Array< noOfDims, ElementType >&)')),
+            ('( const QString & path, const QString & nameFilter, SortFlags sort = SortFlags( Name | IgnoreCase ))', ('', '(const QString&, const QString&, SortFlags)')),
+            ('( GLuint texture_id )', ('', '(GLuint)')),
+            ('( Q3ValueList<T>::size_type i )', ('', '(Q3ValueList< T >::size_type)')),
+            ('(STLAllocator< T, P > const *, STLAllocator< T2, P > const &)', ('', '(STLAllocator< T, P > const *, STLAllocator< T2, P > const &)')),
+            ('(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)', ('', '(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)')),
+            ('(const String &errorMessage, String logName="")', ('', '(const String&, String)')),
+            ('(PixelFormat = PF_BYTE)', ('', '(PixelFormat)')),
+            ('(const SharedPtr< ControllerValue< T > > &src)', ('', '(const SharedPtr< ControllerValue < T > >&)')),
+            ('(typename T::iterator start, typename T::iterator last)', ('', '(typename T::iterator, typename T::iterator)')),
+            ('(const Matrix4 *const *blendMatrices)', ('', '(const Matrix4* const *)')),
+            ('(const Matrix4 *const *blendMatrices) const =0', ('', '(const Matrix4* const *) const')),
+]
+
+varargs = [('(int nb=0,...)', ('','(int, ...)')),
+]
+
+multiple_qualifiers = [('( QReadWriteLock * readWriteLock, unsigned long time = ULONG_MAX )', ('', '(QReadWriteLock*, unsigned long)')),
+]
+
+numbers_for_defaults = [('( const QPixmap & pixmap, const QString & text, int index = -1 )', ('', '(const QPixmap&, const QString&, int)')),
+                        ('( const char ** strings, int numStrings = -1, int index = -1 )', ('', '(const char**, int, int)')),
+                        ('( const QStringList & list, int index = -1 )', ('', '(const QStringList&, int)')),
+]
+
+flags_in_defaults = [('( const QString & text, int column, ComparisonFlags compare = ExactMatch | Qt::CaseSensitive )', ('', '(const QString&, int, ComparisonFlags)')),
+]
+
+functions = [('PolyVox::Volume::getDepth', ('PolyVox::Volume::getDepth', '')),
+             ('PolyVox::Volume::getDepth()', ('PolyVox::Volume::getDepth', '()')),
+             ('Volume::getVoxelAt(uint16_t uXPos, uint16_t uYPos, uint16_t uZPos, VoxelType tDefault=VoxelType()) const', ('Volume::getVoxelAt', '(uint16_t, uint16_t, uint16_t, VoxelType) const')),
+             ('PolyVox::Array::operator[]', ('PolyVox::Array::operator[]', '')),
+             ('operator[]', ('operator[]', '')),
+]
+
+multiple_namespaces = [('PolyVox::Test::TestFunction(int foo)', ('PolyVox::Test::TestFunction', '(int)')),
+]
+
+class TestNormalise(unittest.TestCase):
+	def setUp(self):
+		self.arglists = arglists
+		self.functions = functions
+		self.varargs = varargs
+		self.multiple_qualifiers = multiple_qualifiers
+		self.numbers_for_defaults = numbers_for_defaults
+		self.flags_in_defaults = flags_in_defaults
+		self.multiple_namespaces = multiple_namespaces
+	
+	def test_split_function(self):
+		for function in self.functions:
+			self.assertEqual(parsing.normalise(function[0]), function[1])
+			
+	def test_normalise_arglist(self):
+		for arglist in self.arglists:
+			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
+			
+	def test_varargs(self):
+		for arglist in self.varargs:
+			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
+			
+	def test_multiple_qualifiers(self):
+		for arglist in self.multiple_qualifiers:
+			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
+			
+	def test_numbers_for_defaults(self):
+		for arglist in self.numbers_for_defaults:
+			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
+			
+	def test_flags_in_defaults(self):
+		for arglist in self.flags_in_defaults:
+			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
+			
+	def test_multiple_namespaces(self):
+		for arglist in self.multiple_namespaces:
+			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
+	
+	def test_false_signatures(self):
+		#This is an invalid function argument. Caused by a bug in Doxygen. See openbabel/src/ops.cpp : theOpCenter("center")
+		from pyparsing import ParseException
+		self.assertRaises(ParseException, parsing.normalise, '("center")')
+
+if __name__ == "__main__":
+	try:
+		import cProfile as profile
+	except ImportError:
+		import profile
+	
+	all_tests = arglists + varargs + multiple_qualifiers + functions + numbers_for_defaults + flags_in_defaults
+	all_tests += all_tests + all_tests + all_tests + all_tests
+	
+	profile.runctx("for arglist in all_tests: parsing.normalise(arglist[0])", globals(), locals(), filename='parsing_profile')
+	p = pstats.Stats('parsing_profile')
+	p.strip_dirs().sort_stats('time', 'cum').print_stats(40)
+
+

File doxylink/tox.ini

 deps=
 	py
 commands=
-	python test/test_parser.py
+	python tests/test_parser.py
 
 [testenv:test]
 deps=