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
6a3e0103
Commit
6a3e0103
authored
Jun 25, 2004
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed unused imports
- replaced type() comparisons with faster isinstance() calls
parent
4e76e2a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+5
-6
No files found.
lib/python/DateTime/DateTime.py
View file @
6a3e0103
...
...
@@ -15,10 +15,9 @@
__version__
=
'$Revision: 1.99 $'
[
11
:
-
2
]
import
os
,
re
,
math
,
DateTimeZone
from
time
import
time
,
gmtime
,
localtime
,
asctime
import
re
,
math
,
DateTimeZone
from
time
import
time
,
gmtime
,
localtime
from
time
import
daylight
,
timezone
,
altzone
,
strftime
from
types
import
InstanceType
,
IntType
,
FloatType
,
StringType
,
UnicodeType
from
App.config
import
getConfiguration
...
...
@@ -689,7 +688,7 @@ class DateTime:
if
arg
==
''
:
raise
SyntaxError
,
arg
if
type
(
arg
)
in
[
StringType
,
UnicodeType
]
and
arg
.
lower
()
in
self
.
_tzinfo
.
_zidx
:
if
isinstance
(
arg
,
(
unicode
,
str
))
and
arg
.
lower
()
in
self
.
_tzinfo
.
_zidx
:
# Current time, to be displayed in specified timezone
t
,
tz
=
time
(),
self
.
_tzinfo
.
_zmap
[
arg
.
lower
()]
ms
=
(
t
-
math
.
floor
(
t
))
...
...
@@ -698,7 +697,7 @@ class DateTime:
x
=
_calcDependentSecond
(
tz
,
t
)
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
_calcYMDHMS
(
x
,
ms
)
elif
type
(
arg
)
in
[
StringType
,
UnicodeType
]
:
elif
isinstance
(
arg
,
(
unicode
,
str
))
:
# Date/time string
if
arg
.
find
(
' '
)
==-
1
and
arg
[
4
]
==
'-'
:
...
...
@@ -735,7 +734,7 @@ class DateTime:
sc
=
sc
+
ms
elif
ac
==
2
:
if
type
(
args
[
1
])
==
StringType
:
if
isinstance
(
args
[
1
],
str
)
:
# Seconds from epoch (gmt) and timezone
t
,
tz
=
args
ms
=
(
t
-
math
.
floor
(
t
))
...
...
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