Browse Source

Enabling automated opening of Camtasia from the code.

sachinmanawadi271 7 years ago
parent
commit
c15c12e5df
3 changed files with 39 additions and 11 deletions
  1. 20 0
      BussinessLogic.py
  2. 14 6
      app.py
  3. 5 5
      automate.py

+ 20 - 0
BussinessLogic.py

@@ -0,0 +1,20 @@
+from conf import PathConfig
+import os
+
+class business_logic:
+
+    def convert_files(self,file):
+        Path = PathConfig( )
+        #app = application.Application()
+        backslash = "\\"
+        FolderPaths = Path.getPath()
+        print(FolderPaths[1])
+        print(file)
+        app_path = FolderPaths[1]+backslash+file
+        print(app_path)
+        os.startfile(app_path)
+        #autoit.run("E:\sample\TK Praktikum1.trec")
+        #autoit.win_wait_active("[CLASS:Notepad]", 3)
+        #autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
+        #autoit.win_close("[CLASS:Notepad]")
+        #autoit.control_click("[Class:#32770]", "Button2")

+ 14 - 6
app.py

@@ -1,11 +1,19 @@
 from automate import Automate
-
-
-Files=[]
+from BussinessLogic import business_logic
+Files1=[]
+Files2=[]
 Auto = Automate()
 Paths=Auto.Init()
 
-#Files=Auto.GetFiles(Paths)
-#print (Files)
+Files1=Auto.GetFiles(Paths[0])
+print (Paths[0])
+print (Files1)
+
+#Auto.copyFiles(Paths)
+
+Files2=Auto.GetFiles(Paths[1])
+print (Paths[1])
+print (Files2)
 
-Auto.copyFiles(Paths)
+bi = business_logic()
+bi.convert_files(Files2[0])

+ 5 - 5
automate.py

@@ -6,20 +6,20 @@ import shutil
 class Automate:
     'Initialization Class for Automation'
 
-    files = []
 
     def Init(self):
         Path = PathConfig( )
         FolderPaths = []
         Path.SetPath( )
-        FolderPaths = Path.getPath( )
+        FolderPaths = Path.getPath()
         return FolderPaths
         # print (FolderPaths)
 
     def GetFiles(self, paths):
-        for file in os.listdir( paths[0] ):
-            Automate.files.append( file )
-        return Automate.files
+        files = []
+        for file in os.listdir( paths ):
+            files.append( file )
+        return files
 
     def copyFiles(self, paths):
         for file in os.listdir( paths[0] ):