Add option '-f' for sync'ing only selected folders
This commit is contained in:
parent
2985ddc61e
commit
ec89c3eb53
@ -373,6 +373,15 @@ cd offlineimap-x.y.z</ProgramListing>
|
|||||||
will debug the threading model.
|
will debug the threading model.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry><term>-f <replaceable>foldername</replaceable>[,<replaceable>foldername</replaceable>]</term>
|
||||||
|
<listitem><para> Only sync the specified folders. The
|
||||||
|
<replaceable>foldername</replaceable>s are the
|
||||||
|
untranslated foldernames. This command-line option
|
||||||
|
overrides any <property>folderfilter</property>
|
||||||
|
and <property>folderincludes</property> options in the
|
||||||
|
configuration file.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry><term>-k [<replaceable>section</replaceable>:]<replaceable>option</replaceable>=<replaceable>value</replaceable>
|
<varlistentry><term>-k [<replaceable>section</replaceable>:]<replaceable>option</replaceable>=<replaceable>value</replaceable>
|
||||||
</term>
|
</term>
|
||||||
<listitem><para> Override configuration file option. If
|
<listitem><para> Override configuration file option. If
|
||||||
|
@ -53,7 +53,7 @@ def startup(versionno):
|
|||||||
sys.stdout.write(version.getcmdhelp() + "\n")
|
sys.stdout.write(version.getcmdhelp() + "\n")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
for optlist in getopt(sys.argv[1:], 'P:1oqa:c:d:l:u:hk:')[0]:
|
for optlist in getopt(sys.argv[1:], 'P:1oqa:c:d:l:u:hk:f:')[0]:
|
||||||
options[optlist[0]] = optlist[1]
|
options[optlist[0]] = optlist[1]
|
||||||
|
|
||||||
if options.has_key('-h'):
|
if options.has_key('-h'):
|
||||||
@ -115,6 +115,20 @@ def startup(versionno):
|
|||||||
for section in accounts.getaccountlist(config):
|
for section in accounts.getaccountlist(config):
|
||||||
config.set('Account ' + section, "quick", '-1')
|
config.set('Account ' + section, "quick", '-1')
|
||||||
|
|
||||||
|
if options.has_key('-f'):
|
||||||
|
foldernames = options['-f'].replace(" ", "").split(",")
|
||||||
|
folderfilter = "lambda f: f in %s" % foldernames
|
||||||
|
folderincludes = "[]"
|
||||||
|
for accountname in accounts.getaccountlist(config):
|
||||||
|
account_section = 'Account ' + accountname
|
||||||
|
remote_repo_section = 'Repository ' + \
|
||||||
|
config.get(account_section, 'remoterepository')
|
||||||
|
local_repo_section = 'Repository ' + \
|
||||||
|
config.get(account_section, 'localrepository')
|
||||||
|
for section in [remote_repo_section, local_repo_section]:
|
||||||
|
config.set(section, "folderfilter", folderfilter)
|
||||||
|
config.set(section, "folderincludes", folderincludes)
|
||||||
|
|
||||||
lock(config, ui)
|
lock(config, ui)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -94,6 +94,13 @@ def getcmdhelp():
|
|||||||
one else. The maildir option will enable debugging
|
one else. The maildir option will enable debugging
|
||||||
for certain Maildir operations.
|
for certain Maildir operations.
|
||||||
|
|
||||||
|
-f foldername[,foldername...]
|
||||||
|
Only sync the specified folders. The "foldername"s
|
||||||
|
are the *untranslated* foldernames. This
|
||||||
|
command-line option overrides any "folderfilter"
|
||||||
|
and "folderincludes" options in the configuration
|
||||||
|
file.
|
||||||
|
|
||||||
-k [section:]option=value
|
-k [section:]option=value
|
||||||
Override configuration file option. If"section" is
|
Override configuration file option. If"section" is
|
||||||
omitted, it defaults to "general". Any underscores
|
omitted, it defaults to "general". Any underscores
|
||||||
|
Loading…
Reference in New Issue
Block a user