Refresh module name conflict with datetime
authorlaurent
Fri, 24 Jul 2009 11:13:03 +0200
changeset 385 373635372b93
parent 384 ed27a676d5c9
child 386 2049a2bd8017
Refresh module name conflict with datetime
PLCControler.py
--- a/PLCControler.py	Fri Jul 24 11:07:33 2009 +0200
+++ b/PLCControler.py	Fri Jul 24 11:13:03 2009 +0200
@@ -26,8 +26,8 @@
 from types import StringType, UnicodeType
 import cPickle
 import os,sys,re
+import datetime
 from time import localtime
-from datetime import *
 
 from plcopen import plcopen
 from plcopen.structures import *
@@ -211,7 +211,7 @@
     def CreateNewProject(self, properties):
         # Create the project
         self.Project = plcopen.project()
-        properties["creationDateTime"] = datetime(*localtime()[:6])
+        properties["creationDateTime"] = datetime.datetime(*localtime()[:6])
         self.Project.setfileHeader(properties)
         self.Project.setcontentHeader(properties)
         self.SetFilePath("")
@@ -2436,7 +2436,7 @@
                             values.append(0)
                     if result[-1] is not None:
                         values.append(int(float(result[-1]) * 1000))
-                    new_task.setinterval(time(*values))
+                    new_task.setinterval(datetime.time(*values))
                 new_task.setpriority(int(task["Priority"]))
                 if task["Name"] != "":
                     task_list[task["Name"]] = new_task
@@ -2526,7 +2526,7 @@
             return False
         else:
             contentheader = self.Project.getcontentHeader()
-            contentheader["modificationDateTime"] = datetime(*localtime()[:6])
+            contentheader["modificationDateTime"] = datetime.datetime(*localtime()[:6])
             self.Project.setcontentHeader(contentheader)
             
             text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"