Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-07 Thread Hanno Schlichting
On Mon, Feb 7, 2011 at 2:59 PM, yuppie  wrote:
> If someone knows a better way to detect NTFS, please let me know.

I looked for better ways, but there's nothing good in default Python or pywin32.

The only real approach seems to involve calling the external diskpart
command with a script like "list volumes" and parsing the output...
nothing I'd want to do. And if I remember correctly diskpart isn't
available on old Windows versions either.

Hanno
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-07 Thread yuppie
Alan Runyan wrote:
> just for record, having the behavior makes development a complete nightmare. 
> adding an additional environment variable is probably best way.

I hope this resolves the issue:
http://svn.zope.org/?rev=120180&view=rev

If someone knows a better way to detect NTFS, please let me know.

Cheers, Yuppie
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-07 Thread Alan Runyan
just for record, having the behavior makes development a complete nightmare. 
adding an additional environment variable is probably best way. 

Alan Runyan
Enfold Systems

On Feb 7, 2011, at 5:47 AM, yuppie  wrote:

> yuppie wrote:
>> yuppie wrote:
>> DebugModeTests have been disabled by default. Now I see 3 errors on
>> FAT32 and one error on NTFS:
>> 
>> Error in test test_DeleteAddEditMethod
>> (Products.CMFCore.tests.test_DirectoryView.DebugModeTests)
>> Traceback (most recent call last):
>>File "...\Python26\lib\unittest.py", line 279, in run
>>  testMethod()
>>File
>> "...\src\Products.CMFCore\Products\CMFCore\tests\test_DirectoryView.py",
>> line 290, in test_DeleteAddEditMethod
>>  self.assertEqual(self.ob.fake_skin.test2(),'test2.2')
>> AttributeError: test2
>> 
>> Someone has to figure out if this can be fixed without using the old
>> code for NTFS as well.
> 
> Just for the record: The test was broken, not the tested feature.
> 
> Cheers, Yuppie
> ___
> Zope-CMF maillist  -  Zope-CMF@zope.org
> https://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-07 Thread yuppie
yuppie wrote:
> yuppie wrote:
> DebugModeTests have been disabled by default. Now I see 3 errors on
> FAT32 and one error on NTFS:
>
> Error in test test_DeleteAddEditMethod
> (Products.CMFCore.tests.test_DirectoryView.DebugModeTests)
> Traceback (most recent call last):
> File "...\Python26\lib\unittest.py", line 279, in run
>   testMethod()
> File
> "...\src\Products.CMFCore\Products\CMFCore\tests\test_DirectoryView.py",
> line 290, in test_DeleteAddEditMethod
>   self.assertEqual(self.ob.fake_skin.test2(),'test2.2')
> AttributeError: test2
>
> Someone has to figure out if this can be fixed without using the old
> code for NTFS as well.

Just for the record: The test was broken, not the tested feature.

Cheers, Yuppie
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-03 Thread yuppie
yuppie wrote:
> AFAIK this is primarily a file system issue, not an operating system
> issue. 'Last modified' time is updated on NTFS, but not on FAT32.
>
> Not sure what we need to support: I guess everybody is working with
> Windows versions that support NTFS, but maybe some people still develop
> on FAT32 partitions.

DebugModeTests have been disabled by default. Now I see 3 errors on 
FAT32 and one error on NTFS:

Error in test test_DeleteAddEditMethod 
(Products.CMFCore.tests.test_DirectoryView.DebugModeTests)
Traceback (most recent call last):
   File "...\Python26\lib\unittest.py", line 279, in run
 testMethod()
   File 
"...\src\Products.CMFCore\Products\CMFCore\tests\test_DirectoryView.py", 
line 290, in test_DeleteAddEditMethod
 self.assertEqual(self.ob.fake_skin.test2(),'test2.2')
AttributeError: test2

Someone has to figure out if this can be fixed without using the old 
code for NTFS as well.

Cheers, Yuppie
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-03 Thread yuppie
Hi!


Tres Seaver wrote:
> On 02/02/2011 06:17 PM, Nikolay Kim wrote:
>> well, we tested on modern windows, everything seem to work.
>> but problem is, it is not possible to develop on windows without this
>> patch. it just too slow. removing 'os.path.walk' makes development mode
>> as fast as on linux
[...]
> -if platform == 'win32':
> -# some Windows directories don't change mtime
> -# when a file is added to or deleted from them :-(
> -# So keep a list of files as well, and see if that
> -# changes
[...]
> Can anybody else comment who is doing CMF-based work on Windows?

AFAIK this is primarily a file system issue, not an operating system 
issue. 'Last modified' time is updated on NTFS, but not on FAT32.

Not sure what we need to support: I guess everybody is working with 
Windows versions that support NTFS, but maybe some people still develop 
on FAT32 partitions.

Maybe there is an easy way to detect the file system?


Cheers,

Yuppie
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-02 Thread Charlie Clark
Am 03.02.2011, 00:50 Uhr, schrieb Tres Seaver :

> Can anybody else comment who is doing CMF-based work on Windows?

Not personally but involved with enough projects that also have (largely  
frontend) development on windows.

What are "modern" windows systems?

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-02 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/02/2011 06:17 PM, Nikolay Kim wrote:
> well, we tested on modern windows, everything seem to work.
> but problem is, it is not possible to develop on windows without this
> patch. it just too slow. removing 'os.path.walk' makes development mode
> as fast as on linux
> 
> 
> On Wed, 2011-02-02 at 18:12 -0500, Tres Seaver wrote:
> On 02/02/2011 05:30 PM, Nikolay Kim wrote:
> 
 Modified: Products.CMFCore/trunk/Products/CMFCore/DirectoryView.py
 ===
 --- Products.CMFCore/trunk/Products/CMFCore/DirectoryView.py   
 2011-02-02 22:30:34 UTC (rev 120067)
 +++ Products.CMFCore/trunk/Products/CMFCore/DirectoryView.py   
 2011-02-02 22:30:48 UTC (rev 120068)
 @@ -106,7 +106,6 @@
  class DirectoryInformation:
  data = None
  _v_last_read = 0
 -_v_last_filelist = [] # Only used on Win32
  
  def __init__(self, filepath, reg_key, ignore=ignore):
  self._filepath = filepath
 @@ -159,23 +158,13 @@
  if not Globals.DevelopmentMode:
  return 0
  mtime=0
 -filelist=[]
  try:
  mtime = os.stat(self._filepath)[8]
 -if platform == 'win32':
 -# some Windows directories don't change mtime
 -# when a file is added to or deleted from them :-(
 -# So keep a list of files as well, and see if that
 -# changes
 -os.path.walk(self._filepath, self._walker, filelist)
 -filelist.sort()
  except:
  logger.exception("Error checking for directory modification")
  
 -if mtime != self._v_last_read or filelist != 
 self._v_last_filelist:
 +if mtime != self._v_last_read:
  self._v_last_read = mtime
 -self._v_last_filelist = filelist
 -
  return 1
  
  return 0
> 
> Nikolay,
> 
> The code you removed was there to prevent very real problems some people
> experienced when running on Windows in development mode:  are you sure
> that such users have all moved on to modern enough versions to make this
> change a better tradeoff?
> 
> Maybe we should allow restoring the "safe but slow" behavior with an
> environment variable?

(Sorry for the confusion about ths list -- my earlier message went to
Nikolay directly, but to the zope-cmf list via gmane).

Can anybody else comment who is doing CMF-based work on Windows?


Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1J7bgACgkQ+gerLs4ltQ6KXQCdGNoujM2AjD7dsmItPHvNNGKE
x6gAoNIhP49Cz3ecIQiSEpizoPk0cHLy
=skx6
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/ Removed os.path.walk call in windows development mode

2011-02-02 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/02/2011 05:30 PM, Nikolay Kim wrote:

> Modified: Products.CMFCore/trunk/Products/CMFCore/DirectoryView.py
> ===
> --- Products.CMFCore/trunk/Products/CMFCore/DirectoryView.py  2011-02-02 
> 22:30:34 UTC (rev 120067)
> +++ Products.CMFCore/trunk/Products/CMFCore/DirectoryView.py  2011-02-02 
> 22:30:48 UTC (rev 120068)
> @@ -106,7 +106,6 @@
>  class DirectoryInformation:
>  data = None
>  _v_last_read = 0
> -_v_last_filelist = [] # Only used on Win32
>  
>  def __init__(self, filepath, reg_key, ignore=ignore):
>  self._filepath = filepath
> @@ -159,23 +158,13 @@
>  if not Globals.DevelopmentMode:
>  return 0
>  mtime=0
> -filelist=[]
>  try:
>  mtime = os.stat(self._filepath)[8]
> -if platform == 'win32':
> -# some Windows directories don't change mtime
> -# when a file is added to or deleted from them :-(
> -# So keep a list of files as well, and see if that
> -# changes
> -os.path.walk(self._filepath, self._walker, filelist)
> -filelist.sort()
>  except:
>  logger.exception("Error checking for directory modification")
>  
> -if mtime != self._v_last_read or filelist != self._v_last_filelist:
> +if mtime != self._v_last_read:
>  self._v_last_read = mtime
> -self._v_last_filelist = filelist
> -
>  return 1
>  
>  return 0

Nikolay,

The code you removed was there to prevent very real problems some people
experienced when running on Windows in development mode:  are you sure
that such users have all moved on to modern enough versions to make this
change a better tradeoff?

Maybe we should allow restoring the "safe but slow" behavior with an
environment variable?


Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1J5MEACgkQ+gerLs4ltQ786wCgkPLelxT0eoCVGDtfnBEdRNzv
GXQAmgNOj4Tf1Y8Tcw9ov/8NTvfRke16
=GSUZ
-END PGP SIGNATURE-

___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests