summaryrefslogtreecommitdiff
path: root/lib/feed2imap/config.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/config.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/feed2imap/config.rb b/lib/feed2imap/config.rb
index 53e6543..c0cdddd 100644
--- a/lib/feed2imap/config.rb
+++ b/lib/feed2imap/config.rb
@@ -33,7 +33,7 @@ LOGNAME = Etc.getlogin
# Feed2imap configuration
class F2IConfig
- attr_reader :imap_accounts, :cache, :feeds, :dumpdir, :updateddebug, :max_failures, :include_images, :default_email, :hostname
+ attr_reader :imap_accounts, :cache, :feeds, :dumpdir, :updateddebug, :max_failures, :include_images, :default_email, :hostname, :reupload_if_updated
# Load the configuration from the IO stream
# TODO should do some sanity check on the data read.
@@ -45,9 +45,10 @@ class F2IConfig
@feeds = []
@max_failures = (@conf['max-failures'] || 10).to_i
@updateddebug = (@conf['debug-updated'] and @conf['debug-updated'] != 'false')
- @include_images = (@conf['include-images'] and @conf['include-images'] != 'false')
+ @include_images = !(@conf.has_key?('include-images') and @conf['include-images'] != 'false')
+ @reupload_if_updated = !(@conf.has_key?('reupload-if-updated') and @conf['reupload-if-updated'] == false)
@default_email = (@conf['default-email'] || "#{LOGNAME}@#{HOSTNAME}")
- ImapAccount.no_ssl_verify = (@conf['disable-ssl-verification'] and @conf['disable-ssl-verification'] != 'false')
+ ImapAccount.no_ssl_verify = (@conf.has_key?('disable-ssl-verification') and @conf['disable-ssl-verification'] == true)
@hostname = HOSTNAME # FIXME: should this be configurable as well?
@imap_accounts = ImapAccounts::new
maildir_account = MaildirAccount::new
@@ -94,7 +95,7 @@ end
# A configured feed. simple data container.
class ConfigFeed
- attr_reader :name, :url, :imapaccount, :folder, :always_new, :execurl, :filter, :ignore_hash, :dumpdir, :wrapto, :include_images
+ attr_reader :name, :url, :imapaccount, :folder, :always_new, :execurl, :filter, :ignore_hash, :dumpdir, :wrapto, :include_images, :reupload_if_updated
attr_accessor :body
def initialize(f, imapaccount, folder, f2iconfig)
@@ -111,8 +112,12 @@ class ConfigFeed
@dumpdir = f['dumpdir'] || nil
@wrapto = if f['wrapto'] == nil then 72 else f['wrapto'].to_i end
@include_images = f2iconfig.include_images
- if f['include-images']
- @include_images = (f['include-images'] != 'false')
+ if f.has_key?('include-images')
+ @include_images = (f['include-images'] != false)
+ end
+ @reupload_if_updated = f2iconfig.reupload_if_updated
+ if f.has_key?('reupload-if-updated')
+ @reupload_if_updated = (f['reupload-if-updated'] != false)
end
end
>+53 2010-03-02Added newer PolyML version for IsabelleRené 'Necoro' Neumann2-0/+31 2010-01-05Removed bpythonRené 'Necoro' Neumann2-33/+0 2009-11-11stgit-0.15 in portage nowRené 'Necoro' Neumann2-59/+0 2009-11-10Add stgit-0.15René 'Necoro' Neumann2-0/+59 2009-11-09Emacs stuff now in PortageRené 'Necoro' Neumann8-2222/+0 2009-11-07Emacs with fixed gtk menusRené 'Necoro' Neumann8-0/+2222 2009-10-27Remove old hibernate-script version.René 'Necoro' Neumann2-72/+0 2009-10-25Rename .bzrignore to .gitignoreRené 'Necoro' Neumann1-0/+0 2009-10-25Rename repo from 'necoro_private' to 'necoro'René 'Necoro' Neumann1-1/+1 2009-10-25Remove own hplip versionRené 'Necoro' Neumann4-210/+0 2009-10-25Remove own ctags versionRené 'Necoro' Neumann7-402/+0 2009-10-02Do not create isabelle desktop entryRené 'Necoro' Neumann2-2/+1 2009-09-28Add isabelle ebuildRené 'Necoro' Neumann3-0/+115 2009-09-05Removed glade ebuild. Newer versions included in treeRené 'Necoro' Neumann2-47/+0