Re: [Zope-dev] small manuel bugfix

2009-12-25 Thread Chris McDonough
Benji York wrote:
> On Fri, Dec 25, 2009 at 9:37 PM, Chris McDonough  wrote:
>> I added a branch of manuel to the Zope SVN that fixes the codeblock plugin 
>> when
>> you use codeblock "roles" such as:
> 
> Looks good.  Add tests and I'll merge and release your branch.

Sorry about the no-tests thing. :-(

> I'm not sure what form the tests should take.  There's probably no need
> to reflect this in the documentation, so non-documentation flavored
> tests are appropriate.

Yeah.  I'm a fan of unit tests.

- C
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] small manuel bugfix

2009-12-25 Thread Benji York
On Fri, Dec 25, 2009 at 9:37 PM, Chris McDonough  wrote:
> I added a branch of manuel to the Zope SVN that fixes the codeblock plugin 
> when
> you use codeblock "roles" such as:

Looks good.  Add tests and I'll merge and release your branch.

I'm not sure what form the tests should take.  There's probably no need
to reflect this in the documentation, so non-documentation flavored
tests are appropriate.
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] small manuel bugfix

2009-12-25 Thread Chris McDonough
Ugh, that patch is rendered backwards... but you get the idea.

Chris McDonough wrote:
> I added a branch of manuel to the Zope SVN that fixes the codeblock plugin 
> when 
> you use codeblock "roles" such as:
> 
> .. code-block:: python
> :linenos:
> 
> Currently it only works without roles, e.g.:
> 
> .. code-block:: python
> 
> The branch is at 
> svn+ssh://svn.zope.org/repos/main/manuel/branches/chrism-codeblocks
> 
> The diff against the current head is as follows:
> 
> [chr...@snowpro manuel]$ svn diff 
> ===
> --- src/manuel/codeblock.py   (.../branches/chrism-codeblocks)
> (revision 107071)
> +++ src/manuel/codeblock.py   (.../trunk) (revision 107071)
> @@ -2,9 +2,7 @@
>   import manuel
>   import textwrap
> 
> -CODEBLOCK_START = re.compile(
> -r'(^\.\.\s*(invisible-)?code-block::?\s*python\b(?:\s*\:\w+\:)*)',
> -re.MULTILINE)
> +CODEBLOCK_START = 
> re.compile(r'^\.\.\s*(invisible-)?code-block::?\s*python\b', 
> re.MULTILINE)
>   CODEBLOCK_END = re.compile(r'(\n\Z|\n(?=\S))')
> 
> 
> @@ -15,8 +13,7 @@
> 
>   def find_code_blocks(document):
>   for region in document.find_regions(CODEBLOCK_START, CODEBLOCK_END):
> -start_end = CODEBLOCK_START.search(region.source).end()
> -source = textwrap.dedent(region.source[start_end:])
> +source = textwrap.dedent('\n'.join(region.source.splitlines()[1:]))
>   source_location = '%s:%d' % (document.location, region.lineno)
>   code = compile(source, source_location, 'exec', 0, True)
>   document.claim_region(region)
> 
> I submit it for Benji's consideration.
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
> 

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] small manuel bugfix

2009-12-25 Thread Chris McDonough
I added a branch of manuel to the Zope SVN that fixes the codeblock plugin when 
you use codeblock "roles" such as:

.. code-block:: python
:linenos:

Currently it only works without roles, e.g.:

.. code-block:: python

The branch is at 
svn+ssh://svn.zope.org/repos/main/manuel/branches/chrism-codeblocks

The diff against the current head is as follows:

[chr...@snowpro manuel]$ svn diff 
===
--- src/manuel/codeblock.py (.../branches/chrism-codeblocks)
(revision 107071)
+++ src/manuel/codeblock.py (.../trunk) (revision 107071)
@@ -2,9 +2,7 @@
  import manuel
  import textwrap

-CODEBLOCK_START = re.compile(
-r'(^\.\.\s*(invisible-)?code-block::?\s*python\b(?:\s*\:\w+\:)*)',
-re.MULTILINE)
+CODEBLOCK_START = re.compile(r'^\.\.\s*(invisible-)?code-block::?\s*python\b', 
re.MULTILINE)
  CODEBLOCK_END = re.compile(r'(\n\Z|\n(?=\S))')


@@ -15,8 +13,7 @@

  def find_code_blocks(document):
  for region in document.find_regions(CODEBLOCK_START, CODEBLOCK_END):
-start_end = CODEBLOCK_START.search(region.source).end()
-source = textwrap.dedent(region.source[start_end:])
+source = textwrap.dedent('\n'.join(region.source.splitlines()[1:]))
  source_location = '%s:%d' % (document.location, region.lineno)
  code = compile(source, source_location, 'exec', 0, True)
  document.claim_region(region)

I submit it for Benji's consideration.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 6 OK

2009-12-25 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Dec 24 12:00:00 2009 UTC to Fri Dec 25 12:00:00 2009 UTC.
There were 6 messages: 6 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Dec 24 20:41:17 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013257.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Dec 24 20:43:17 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013258.html

Subject: OK : Zope-2.12 Python-2.6.4 : Linux
From: Zope Tests
Date: Thu Dec 24 20:45:17 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013259.html

Subject: OK : Zope-2.12-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Thu Dec 24 20:47:17 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013260.html

Subject: OK : Zope-trunk Python-2.6.4 : Linux
From: Zope Tests
Date: Thu Dec 24 20:49:17 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013261.html

Subject: OK : Zope-trunk-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Thu Dec 24 20:51:17 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013262.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-25 Thread Lennart Regebro
On Fri, Dec 25, 2009 at 07:49, Fabio Tranchitella  wrote:
>> No, that's perferctly correct code and not wrong in any way.
>
> It is not wrong from a syntax point of view, but it is wrong because it
> assumes doctest is a sub-module and not a sub-package.

I understand the difference, but the fact is that up until yesterday
it *was* a submodule, and hence it was correct and valid code. There
are no PEP8 rules against doing this, hence it has to be viewed as
valid code. Ugly yes, but you can't say it's wrong.

>> What if we hide the warning during the __init__.py import. Will it
>> show up the next time, then?
>
> No, because modules/packages are imported only once.

Right.

>> Maybe we can add deprecations only for the major names in doctest.py?
>> That would still raise an error everytime you use it, but only when you
>> import a name, not the module.
>
> I thought we deprecated the whole zope.testing.doctest.

Yes, we did. But now we try to get the deprecation warnings to show up
in the correct place. And we could warn for the usage of some of the
names, but in the message explain that doctest.py is deprecated.

> Best regards, and Merry Christmas.

The same!

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )