Browse Source

Update copyright notice; some additions.

tags/v0.1
Ben Kurtovic 12 years ago
parent
commit
4cb3506820
13 changed files with 22 additions and 18 deletions
  1. +1
    -1
      LICENSE
  2. +2
    -2
      mwparserfromhell/__init__.py
  3. +1
    -1
      mwparserfromhell/node.py
  4. +1
    -1
      mwparserfromhell/parameter.py
  5. +1
    -1
      mwparserfromhell/parser.py
  6. +3
    -3
      mwparserfromhell/string_mixin.py
  7. +1
    -1
      mwparserfromhell/template.py
  8. +1
    -1
      mwparserfromhell/text.py
  9. +5
    -1
      mwparserfromhell/wikicode.py
  10. +1
    -1
      setup.py
  11. +3
    -3
      tests/test_parameter.py
  12. +1
    -1
      tests/test_parser.py
  13. +1
    -1
      tests/test_template.py

+ 1
- 1
LICENSE View File

@@ -1,4 +1,4 @@
Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>


Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal


+ 2
- 2
mwparserfromhell/__init__.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@@ -27,7 +27,7 @@ outrageously powerful parser for `MediaWiki <http://mediawiki.org>`_ wikicode.
""" """


__author__ = "Ben Kurtovic" __author__ = "Ben Kurtovic"
__copyright__ = "Copyright (C) 2012 by Ben Kurtovic"
__copyright__ = "Copyright (C) 2012 Ben Kurtovic"
__license__ = "MIT License" __license__ = "MIT License"
__version__ = "0.1.dev" __version__ = "0.1.dev"
__email__ = "ben.kurtovic@verizon.net" __email__ = "ben.kurtovic@verizon.net"


+ 1
- 1
mwparserfromhell/node.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 1
- 1
mwparserfromhell/parameter.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 1
- 1
mwparserfromhell/parser.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 3
- 3
mwparserfromhell/string_mixin.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@@ -24,10 +24,10 @@ __all__ = ["StringMixIn"]


class StringMixIn(object): class StringMixIn(object):
def __str__(self): def __str__(self):
return str(unicode(self))
return unicode(self).encode("utf8")


def __repr__(self): def __repr__(self):
return repr(unicode(self))
return repr(unicode(self).encode("utf8"))


def __lt__(self, other): def __lt__(self, other):
if isinstance(other, unicodeingMixin): if isinstance(other, unicodeingMixin):


+ 1
- 1
mwparserfromhell/template.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 1
- 1
mwparserfromhell/text.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 5
- 1
mwparserfromhell/wikicode.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@@ -182,6 +182,10 @@ class Wikicode(StringMixIn):
def filter_text(self, recursive=False, matches=None, flags=FLAGS): def filter_text(self, recursive=False, matches=None, flags=FLAGS):
return list(self.ifilter_text(recursive, matches, flags)) return list(self.ifilter_text(recursive, matches, flags))


def normalize(self):
## Create a deep copy of self ##
return normalized

def show_tree(self): def show_tree(self):
marker = object() # Random object we can find with certainty in a list marker = object() # Random object we can find with certainty in a list
print "\n".join(self._show_tree(self, [], marker)) print "\n".join(self._show_tree(self, [], marker))

+ 1
- 1
setup.py View File

@@ -1,7 +1,7 @@
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 3
- 3
tests/test_parameter.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@@ -102,12 +102,12 @@ class TestParameter(unittest.TestCase):
# add param # add param
# add template left # add template left
# add template right # add template right
self.assertEquals(param * 3, Parameter(param.name, param.value * 3, self.assertEquals(param * 3, Parameter(param.name, param.value * 3,
param.templates * 3)) param.templates * 3))
self.assertEquals(3 * param, Parameter(param.name, 3 * param.value, self.assertEquals(3 * param, Parameter(param.name, 3 * param.value,
3 * param.templates)) 3 * param.templates))
# add param inplace # add param inplace
# add template implace # add template implace
# add str inplace # add str inplace


+ 1
- 1
tests/test_parser.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


+ 1
- 1
tests/test_template.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (C) 2012 by Ben Kurtovic <ben.kurtovic@verizon.net>
# Copyright (C) 2012 Ben Kurtovic <ben.kurtovic@verizon.net>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal


Loading…
Cancel
Save