Example #1
0
        public void CreateSampleScript(TextWriter w)
        {
            w.WriteLine("# This is a sample configuration script for sammy.");
            w.WriteLine("# Uncomment the lines below to configure how sammy collects");
            w.WriteLine("# your account statements.");
            w.WriteLine("# Check http://code.google.com/p/sammy/wiki/ConfigurationScript for details.");
            w.WriteLine();

            Parser p = new Parser(this);

            foreach (Cmd.Action i in p.Actions)
            {
                i.PrintScriptFileSample(w);
            }
            foreach (Option i in p.Options)
            {
                i.PrintScriptFileSample(w);
            }

            w.WriteLine("# Collector plugins");
            w.WriteLine();

            foreach (Type i in CollectorPlugins)
            {
                string u = Usage.Get(i);
                if (u != null)
                {
                    w.Write("# ");  w.WriteLine(u);
                    w.Write("# "); w.WriteLine(Collectors.Syntax(i));
                    w.WriteLine();
                }
            }
        }
Example #2
0
 public void Collect()
 {
     using (ThreadContext.Stacks["NDC"].Push(User))
     {
         log.InfoFormat("Collecting statements for user {0}", User);
         Collectors collector = new Collectors();
         collector.Payments = Payments;
         collector.Exec(Settings.Script);
         log.InfoFormat("Finished collecting statements for user {0}", User);
     }
 }
Example #3
0
        public void Create()
        {
            if (Exists)
            {
                throw new System.IO.IOException("Exists: " + DbConnection);
            }
            log.InfoFormat("Create user={0}", user);
            DbFile.EnsureParentDirectoryExists();
            settings = new Settings();
            Collectors   c = new Collectors();
            StringWriter w = new StringWriter();

            c.CreateSampleScript(w);
            settings.Script = w.ToString();
            Write();
        }
Example #4
0
 public void Instructions()
 {
     Collectors c = new Collectors();
     c.CreateSampleScript(Console.Out);
 }
Example #5
0
 public void Postbank()
 {
     Collectors c = new Collectors();
     c.Payments = a.Payments;
     c.ExecFile(SecretFile("test-Postbank.command"));
 }
Example #6
0
 public void Html1822direkt()
 {
     Collectors c = new Collectors();
     c.Payments = a.Payments;
     ScrapeForm.ShowBrowser = true;
     c.ExecFile(SecretFile("test-1822direkt.command"));
 }
Example #7
0
 public void Hbci()
 {
     Collectors c = new Collectors();
     c.Payments = a.Payments;
     c.ExecFile(SecretFile("test-hbci.command"));
 }
Example #8
0
 public void Dkb()
 {
     Collectors c = new Collectors();
     c.Payments = a.Payments;
     c.ExecFile(SecretFile("test-dkb.command"));
 }
Example #9
0
 public void TestGetCollector()
 {
     Collectors c = new Collectors();
     Type t = c.GetCollector("Dkb");
     Assert.AreEqual("Dkb", t.Name);
 }