Browse Source

changed parser, added variables, added skeleton

Sam Flint 10 years ago
parent
commit
c508dbc07d
1 changed files with 18 additions and 4 deletions
  1. 18 4
      email2orgsched.org

+ 18 - 4
email2orgsched.org

@@ -26,25 +26,39 @@
 #+Name: Imports
 #+BEGIN_SRC python
   import os, sys, re
-  from email.parser import HeaderParser
+  from email.parser import Parser as parsemail
 #+END_SRC
 #+CAPTION: use-name-as-caption
 We use each library for a purpose:
- - os :: foo
+ - os :: this is used to access environment variables
  - sys :: is used to access arguments, input
  - re :: used for matching and extraction
- - HeaderParser from email.parser :: blarg
+ - Parser as parsemail from email.parser :: This is use to parse email messages from standard input
 ** Variables
 #+Name: MiscVars
 #+BEGIN_SRC python
-
+  data = {}
+  agendafile = '~/org/emailagenda.org'
+  level = 1
+  type = 'inactive'
+  if os.environ['EMAILTOAGENDAFILE']:
+     agendafile = os.environ['EMAILTOAGENDAFILE']
+  
 #+END_SRC
 #+CAPTION: use-name-as-caption
+ - data :: a dictionary used to store data for output
+ - agendafile :: this is set by default to =~/org/emailagenda.org=. if the environment variable =EMAILTOAGENDAFILE= is defined that is used
+ - level :: this is the level you want the heading to be, defaults to level 1, the top.
+ - type :: this is the type of timestamp to be generated, either =active= or =inactive=, defaults to =inactive=.
 ** Subroutines
 #+Name: Subroutines
 #+BEGIN_SRC python
 
 #+END_SRC
 #+CAPTION: use-name-as-caption
+*** Output
+*** Determine Type
+*** Parse header
+
 ** Main body
 ** Final code