diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6b10b1c..f044b7f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,13 +2,7 @@ - - - - - - - + - - + + @@ -118,14 +112,14 @@ - + - - + + - + @@ -135,7 +129,7 @@ - + @@ -159,7 +153,7 @@ - + @@ -172,7 +166,7 @@ - + @@ -220,8 +214,8 @@ @@ -474,7 +468,6 @@ - @@ -487,7 +480,7 @@ - + @@ -548,7 +541,7 @@ - + @@ -582,7 +575,7 @@ - + @@ -602,7 +595,7 @@ - + @@ -610,21 +603,10 @@ - - - - - - - - - - - - - + + @@ -632,5 +614,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/main.py b/main.py index 4d7578e..0fe3c72 100644 --- a/main.py +++ b/main.py @@ -70,44 +70,45 @@ class Main(window.Window): self.do_connect() def do_connect(self): - try: - self.git = git.Git(hostname=self.hostname.get(), - user=self.user_name.get(), passwd=self.password.get(), - path="/home/git/") - except paramiko.ssh_exception.AuthenticationException: - self.connection_status["text"] = "Failed" - showinfo(message="Authentication failed.") - return + if self.git is None: + try: + self.git = git.Git(hostname=self.hostname.get(), + user=self.user_name.get(), passwd=self.password.get(), + path="/home/git/") + except paramiko.ssh_exception.AuthenticationException: + self.connection_status["text"] = "Failed" + showinfo(message="Authentication failed.") + return - self.connection_status["text"] = "Succeed" - - try: - self.git.base_init() - self.git.update_projects() - self.broad.insert(INSERT, "--------------------------\n") - self.broad.insert(INSERT, "SSH Connection [Succeed]\n") - self.broad.insert(INSERT, "Hostame: "+self.hostname.get()+"\n") - self.broad.insert(INSERT, "User: "+self.user_name.get()+"\n") - if self.save_info is not None: - self.git.set_local(self.save_info["local_path"]) - self.broad.insert(INSERT, "Set Local Path...OK" + "\n") - self.local_path_label["text"] = "Local Path:"+self.save_info["local_path"] + self.connection_status["text"] = "Succeed" + try: + self.git.base_init() self.git.update_projects() - self.git.list_projects() - if self.save_info["fix_project"]+".git" in self.git.projects_list: - self.broad.insert(INSERT, "--------------------------\n") - self.broad.insert(INSERT, "Auto Fix Project ({0})\n".format(self.save_info["fix_project"] + ".git")) - self.git.fix_project(self.save_info["fix_project"]) - self.fix_local_plus() - self.broad.see(END) - self.fix_project_label["text"] = "Fixed Project: {0}".format(self.save_info["fix_project"]) + self.broad.insert(INSERT, "--------------------------\n") + self.broad.insert(INSERT, "SSH Connection [Succeed]\n") + self.broad.insert(INSERT, "Hostame: "+self.hostname.get()+"\n") + self.broad.insert(INSERT, "User: "+self.user_name.get()+"\n") + if self.save_info is not None: + self.git.set_local(self.save_info["local_path"]) + self.broad.insert(INSERT, "Set Local Path...OK" + "\n") + self.local_path_label["text"] = "Local Path:"+self.save_info["local_path"] - self.broad.see(END) + self.git.update_projects() + self.git.list_projects() + if self.save_info["fix_project"]+".git" in self.git.projects_list: + self.broad.insert(INSERT, "--------------------------\n") + self.broad.insert(INSERT, "Auto Fix Project ({0})\n".format(self.save_info["fix_project"] + ".git")) + self.git.fix_project(self.save_info["fix_project"]) + self.fix_local_plus() + self.broad.see(END) + self.fix_project_label["text"] = "Fixed Project: {0}".format(self.save_info["fix_project"]) - except AttributeError as errinfo: - showinfo(message=errinfo) - return + self.broad.see(END) + + except AttributeError as errinfo: + showinfo(message=errinfo) + return def do_list(self): try: