add no-sync option

This commit is contained in:
Adrien Waksberg 2015-09-27 09:13:43 +02:00
parent 631f693d06
commit 6b14e8f881
4 changed files with 16 additions and 2 deletions
lib/mpw/ui

View file

@ -23,8 +23,15 @@ class Cli
end
# Sync the data with the server
# @args: allow_sync -> allow or disable sync (boolean)
# @rtnr: true if the synchro is finish
def sync
def sync(allow_sync=nil)
if not allow_sync.nil?
@allow_sync = allow_sync
end
return true if not @allow_sync
@sync = MPW::Sync.new(@config, @mpw, @password)
raise(@sync.error_msg) if not @sync.get_remote