Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
4e6433dc
Commit
4e6433dc
authored
Apr 27, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finally regex free - tried to survive
parent
acd54c86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
ZServer/medusa/filesys.py
ZServer/medusa/filesys.py
+3
-5
lib/python/ZServer/medusa/filesys.py
lib/python/ZServer/medusa/filesys.py
+3
-5
No files found.
ZServer/medusa/filesys.py
View file @
4e6433dc
# -*- Mode: Python; tab-width: 4 -*-
# $Id: filesys.py,v 1.
7 2001/04/25 19:07:30
andreas Exp $
# $Id: filesys.py,v 1.
8 2001/04/27 18:25:42
andreas Exp $
# Author: Sam Rushing <rushing@nightmare.com>
#
# Generic filesystem interface.
...
...
@@ -69,9 +69,8 @@ class abstract_filesystem:
# what to do if wd is an invalid directory?
import
os
import
os
,
re
import
stat
import
string
def
safe_stat
(
path
):
...
...
@@ -80,7 +79,6 @@ def safe_stat (path):
except
:
return
None
import
regsub
import
glob
class
os_filesystem
:
...
...
@@ -171,7 +169,7 @@ class os_filesystem:
# utility methods
def
normalize
(
self
,
path
):
# watch for the ever-sneaky '/+' path element
path
=
re
gsub
.
g
sub
(
'/+'
,
'/'
,
path
)
path
=
re
.
sub
(
'/+'
,
'/'
,
path
)
p
=
self
.
path_module
.
normpath
(
path
)
# remove 'dangling' cdup's.
if
len
(
p
)
>
2
and
p
[:
3
]
==
'/..'
:
...
...
lib/python/ZServer/medusa/filesys.py
View file @
4e6433dc
# -*- Mode: Python; tab-width: 4 -*-
# $Id: filesys.py,v 1.
7 2001/04/25 19:07:30
andreas Exp $
# $Id: filesys.py,v 1.
8 2001/04/27 18:25:42
andreas Exp $
# Author: Sam Rushing <rushing@nightmare.com>
#
# Generic filesystem interface.
...
...
@@ -69,9 +69,8 @@ class abstract_filesystem:
# what to do if wd is an invalid directory?
import
os
import
os
,
re
import
stat
import
string
def
safe_stat
(
path
):
...
...
@@ -80,7 +79,6 @@ def safe_stat (path):
except
:
return
None
import
regsub
import
glob
class
os_filesystem
:
...
...
@@ -171,7 +169,7 @@ class os_filesystem:
# utility methods
def
normalize
(
self
,
path
):
# watch for the ever-sneaky '/+' path element
path
=
re
gsub
.
g
sub
(
'/+'
,
'/'
,
path
)
path
=
re
.
sub
(
'/+'
,
'/'
,
path
)
p
=
self
.
path_module
.
normpath
(
path
)
# remove 'dangling' cdup's.
if
len
(
p
)
>
2
and
p
[:
3
]
==
'/..'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment