# Path: memacs/phonecalls_superbackup.py
# class PhonecallsSuperBackupMemacs(Memacs):
#     def _parser_add_arguments(self):
#         """
#         overwritten method of class Memacs
# 
#         add additional arguments
#         """
#         Memacs._parser_add_arguments(self)
# 
#         self._parser.add_argument(
#             "-f", "--file", dest="smsxmlfile",
#             action="store", required=True,
#             help="path to sms xml backup file")
# 
#         self._parser.add_argument(
#             "--ignore-incoming", dest="ignore_incoming",
#             action="store_true",
#             help="ignore incoming phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-outgoing", dest="ignore_outgoing",
#             action="store_true",
#             help="ignore outgoing phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-missed", dest="ignore_missed",
#             action="store_true",
#             help="ignore outgoing phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-voicemail", dest="ignore_voicemail",
#             action="store_true",
#             help="ignore voicemail phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-rejected", dest="ignore_rejected",
#             action="store_true",
#             help="ignore rejected phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-refused", dest="ignore_refused",
#             action="store_true",
#             help="ignore refused phonecalls")
# 
#         self._parser.add_argument(
#             "--minimum-duration", dest="minimum_duration",
#             action="store", type=int,
#             help="[sec] show only calls with duration >= this argument")
# 
# 
#     def _parser_parse_args(self):
#         """
#         overwritten method of class Memacs
# 
#         all additional arguments are parsed in here
#         """
#         Memacs._parser_parse_args(self)
#         if not (os.path.exists(self._args.smsxmlfile) or \
#                      os.access(self._args.smsxmlfile, os.R_OK)):
#             self._parser.error("input file not found or not readable")
# 
# 
#     def _main(self):
#         """
#         gets called automatically from Memacs class.
#         read the lines from phonecalls backup xml file,
#         parse and write them to org file
#         """
# 
#         data = CommonReader.get_data_from_file(self._args.smsxmlfile)
# 
#         try:
#             xml.sax.parseString(data.encode('utf-8'),
#                                 PhonecallsSaxHandler(self._writer,
#                                               self._args.ignore_incoming,
#                                               self._args.ignore_outgoing,
#                                               self._args.ignore_missed,
#                                               self._args.ignore_voicemail,
#                                               self._args.ignore_rejected,
#                                               self._args.ignore_refused,
#                                               self._args.minimum_duration or 0,
#                                               ))
#         except SAXParseException:
#             logging.error("No correct XML given")
#             sys.exit(1)


from memacs.phonecalls_superbackup import PhonecallsSuperBackupMemacs
PROG_VERSION_NUMBER = "0.1"
PROG_VERSION_DATE = "2012-03-08"
PROG_SHORT_DESCRIPTION = "Memacs for phonecalls"
PROG_TAG = "phonecalls"
PROG_DESCRIPTION = """
This Memacs module will parse output of phonecalls xml backup files

sample xml file:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<calls count="8">
  <call number="+43691234123" duration="59" date="1312563906092" type="1" />
  <call number="06612341234" duration="22" date="1312541215834" type="2" />
  <call number="-1" duration="382" date="1312530691081" type="1" />
  <call number="+4312341234" duration="289" date="1312482327195" type="1" />
  <call number="+4366412341234" duration="70" date="1312476334059" type="1" />
  <call number="+4366234123" duration="0" date="1312473751975" type="2" />
  <call number="+436612341234" duration="0" date="1312471300072" type="3" />
  <call number="+433123412" duration="60" date="1312468562489" type="2" />
</calls>

Then an Org-mode file is generated.
"""
COPYRIGHT_YEAR = "2011-2013"
COPYRIGHT_AUTHORS = """Karl Voit <tools@Karl-Voit.at>,
Armin Wieser <armin.wieser@gmail.com>
Ian Barton <ian@manor-farm.org>"""


def main():
    global memacs

# Path: memacs/phonecalls_superbackup.py
# class PhonecallsSuperBackupMemacs(Memacs):
#     def _parser_add_arguments(self):
#         """
#         overwritten method of class Memacs
# 
#         add additional arguments
#         """
#         Memacs._parser_add_arguments(self)
# 
#         self._parser.add_argument(
#             "-f", "--file", dest="smsxmlfile",
#             action="store", required=True,
#             help="path to sms xml backup file")
# 
#         self._parser.add_argument(
#             "--ignore-incoming", dest="ignore_incoming",
#             action="store_true",
#             help="ignore incoming phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-outgoing", dest="ignore_outgoing",
#             action="store_true",
#             help="ignore outgoing phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-missed", dest="ignore_missed",
#             action="store_true",
#             help="ignore outgoing phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-voicemail", dest="ignore_voicemail",
#             action="store_true",
#             help="ignore voicemail phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-rejected", dest="ignore_rejected",
#             action="store_true",
#             help="ignore rejected phonecalls")
# 
#         self._parser.add_argument(
#             "--ignore-refused", dest="ignore_refused",
#             action="store_true",
#             help="ignore refused phonecalls")
# 
#         self._parser.add_argument(
#             "--minimum-duration", dest="minimum_duration",
#             action="store", type=int,
#             help="[sec] show only calls with duration >= this argument")
# 
# 
#     def _parser_parse_args(self):
#         """
#         overwritten method of class Memacs
# 
#         all additional arguments are parsed in here
#         """
#         Memacs._parser_parse_args(self)
#         if not (os.path.exists(self._args.smsxmlfile) or \
#                      os.access(self._args.smsxmlfile, os.R_OK)):
#             self._parser.error("input file not found or not readable")
# 
# 
#     def _main(self):
#         """
#         gets called automatically from Memacs class.
#         read the lines from phonecalls backup xml file,
#         parse and write them to org file
#         """
# 
#         data = CommonReader.get_data_from_file(self._args.smsxmlfile)
# 
#         try:
#             xml.sax.parseString(data.encode('utf-8'),
#                                 PhonecallsSaxHandler(self._writer,
#                                               self._args.ignore_incoming,
#                                               self._args.ignore_outgoing,
#                                               self._args.ignore_missed,
#                                               self._args.ignore_voicemail,
#                                               self._args.ignore_rejected,
#                                               self._args.ignore_refused,
#                                               self._args.minimum_duration or 0,
#                                               ))
#         except SAXParseException:
#             logging.error("No correct XML given")
#             sys.exit(1)


# Path: bin/memacs_phonecalls_superbackup.py
from memacs.phonecalls_superbackup import PhonecallsSuperBackupMemacs

PROG_VERSION_NUMBER = "0.1"
PROG_VERSION_DATE = "2012-03-08"
PROG_SHORT_DESCRIPTION = "Memacs for phonecalls"
PROG_TAG = "phonecalls"
PROG_DESCRIPTION = """
This Memacs module will parse output of phonecalls xml backup files

sample xml file:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<calls count="8">
  <call number="+43691234123" duration="59" date="1312563906092" type="1" />
  <call number="06612341234" duration="22" date="1312541215834" type="2" />
  <call number="-1" duration="382" date="1312530691081" type="1" />
  <call number="+4312341234" duration="289" date="1312482327195" type="1" />
  <call number="+4366412341234" duration="70" date="1312476334059" type="1" />
  <call number="+4366234123" duration="0" date="1312473751975" type="2" />
  <call number="+436612341234" duration="0" date="1312471300072" type="3" />
  <call number="+433123412" duration="60" date="1312468562489" type="2" />
</calls>

Then an Org-mode file is generated.
"""
COPYRIGHT_YEAR = "2011-2013"
COPYRIGHT_AUTHORS = """Karl Voit <tools@Karl-Voit.at>,
Armin Wieser <armin.wieser@gmail.com>
Ian Barton <ian@manor-farm.org>"""


def main():
    global memacs

    memacs = PhonecallsSuperBackupMemacs(