From 28ce0c44e7995e7e4629c1fa33f0f1793ba7bfaf Mon Sep 17 00:00:00 2001 From: Tomas Touceda Date: Tue, 9 Apr 2013 16:53:53 -0300 Subject: Ensure events server from the launcher and change the renaming for windows --- src/launcher.py | 4 ++++ src/main.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/launcher.py b/src/launcher.py index 8b6c9a2..7d95336 100644 --- a/src/launcher.py +++ b/src/launcher.py @@ -4,6 +4,8 @@ import time import threading from leap.app import main as leap_client +from leap.common.events import server + from thandy.ClientCLI import update as thandy_update @@ -37,6 +39,8 @@ class Thandy(threading.Thread): if __name__ == "__main__": + server.ensure_server(port=8090) + thandy_thread = Thandy() thandy_thread.daemon = True thandy_thread.start() diff --git a/src/main.cpp b/src/main.cpp index ca066cd..a2a3fcf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,7 @@ removeTemps(const std::string source = ".") if (fs::is_regular_file(dir_iter->status())) { auto filename = dir_iter->path().filename(); - if (boost::starts_with(filename.string(), TEMP_PREFIX)) + if (boost::ends_with(filename.string(), TEMP_PREFIX)) { std::cout << "remove " << dir_iter->path() << std::endl; fs::remove(dir_iter->path()); @@ -71,7 +71,7 @@ mergeDirectories(const fs::path &source, if (fs::exists(destFilePath)) { // On windows we can't remove, but we can rename and afterwards remove - auto tempFilePath = dest / fs::path("__tmp_" + filename.string()); + auto tempFilePath = dest / fs::path(filename.string() + TEMP_PREFIX); //fs::remove(destFilePath); fs::rename(destFilePath, tempFilePath); } -- cgit v1.2.3