Permalink
Browse files

Licence snippets & unused imports cleanup

--HG--
branch : sneakylang
  • Loading branch information...
1 parent 74d4d1b commit f263d9fa1c4b7bdce3a976f76cd72ffc947e2580 almad committed Mar 10, 2009
View
@@ -2,33 +2,17 @@
""" SneakyLang: Extensible WikiFramework """
-__version__ = [0.3, "alpha", 4]
-__versionstr__ = "0.3_alpha4"
-
-###
-# SneakyLang: Extensible WikiFramework
-# Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/czechtile/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
+__version__ = [0, 3, 0, "final"]
+__versionstr__ = "0.3.0"
from document import Document
from expanders import expand
from macro import Macro
from parser import parse
from register import Register, RegisterMap
from treebuilder import TreeBuilder
+
+__all__ = (
+ "Document", "Macro", "Register", "RegisterMap", "TreeBuilder",
+ "parse", "expand",
+)
View
@@ -2,27 +2,6 @@
""" Default document macro/nodes """
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/sneakylang/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
import logging
from macro import Macro
View
@@ -3,27 +3,6 @@
""" SneakyLang-specific errors
"""
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2007 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/czechtile/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
class Error(Exception): pass
class MacroCallError(Error):
View
@@ -3,27 +3,6 @@
""" Expanders for nodes
"""
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/czechtile/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
from cgi import escape
from err import *
View
@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*-
""" Macro superclass and default Document and Macro classes """
-import re
import logging
logging = logging.getLogger('sneakylang')
from err import *
-import node
from macro_caller import parse_macro_arguments
class Macro(object):
View
@@ -1,36 +1,15 @@
# -*- coding: utf-8 -*-
-###
-# SneakyLang: Extensible WikiFramework
-# Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/sneakylang/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
-""" Set of funcitons and constants
+"""
+Set of functions and constants
needed to perform proper call when calling macros with
extensive syntax ((macro_name argument argument))
All those functions are meant to be overwritten by
implementation and should be as forward-compatible as possible.
- """
+"""
-import re
import logging
from err import *
View
@@ -8,27 +8,6 @@
Post- macro hooks are useful for rebuilding or inspecting tree
"""
-###
-# SneakyLang: Extensible WikiFramework
-# Copyright (C) 2007 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/sneakylang/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
class MacroHook(object):
""" Main MacroHook class. Subclass this one to make real MacroHook """
macro = None
View
@@ -1,31 +1,8 @@
# -*- coding: utf-8 -*-
-""" Representation of nodes in Document
"""
-
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2007 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/czechtile/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
-import re
-import logging
+Representation of nodes in Document
+"""
from expanders import *
View
@@ -1,37 +1,15 @@
# -*- coding: utf-8 -*-
-""" Parser transforming input stream to DOM
"""
-
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2007 Lukas "Almad" Linhart http://www.almad.net/
-# and contributors, for complete list see
-# http://projects.almad.net/sneakylang/wiki/Contributors
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
+Parser transforming input stream to DOM
+"""
import logging
from err import ParserRollback, MacroCallError
-import macro
from node import TextNode
from register import Register
-from macro_caller import expand_macro_from_stream
from treebuilder import TreeBuilder
#FIXME
View
@@ -1,31 +1,11 @@
# -*- coding: utf-8 -*-
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
-import logging
from re import compile, UNICODE
from expanders import Expander
from macro_caller import get_macro_name, expand_macro_from_stream
-__all__ = ['ExpanderRegister', 'ParserRegister', 'Register', 'RegisterMap']
+__all__ = ('ExpanderRegister', 'ParserRegister', 'Register', 'RegisterMap')
class RegisterMap(dict):
""" Register map is dictionary holding macro : register_with_allowed_macros pair """
@@ -3,28 +3,10 @@
""" Module for commons shared by tests """
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2006 Lukas "Almad" Linhart http://www.almad.net/
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
import re
-import os, sys
+import os
+import sys
import logging
logging = logging.getLogger('sneakylang')
@@ -35,11 +17,9 @@
from sneakylang.err import ParserRollback, MacroCallError
from sneakylang.macro import Macro
-from sneakylang.macro_caller import parse_macro_arguments
from sneakylang.node import Node, TextNode
from sneakylang.parser import *
-from sneakylang.register import Register
-from sneakylang.expanders import Expander, expand, TextNodeExpander
+from sneakylang.expanders import Expander, expand
class DummyMacro(Macro):
name = 'dummy_macro'
View
@@ -1,28 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-###
-# SneakyLang: Extensible WikiFramework
-#Copyright (C) 2007 Lukas "Almad" Linhart http://www.almad.net/
-#
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License as published by the Free Software Foundation; either
-#version 2.1 of the License, or (at your option) any later version.
-#
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#Lesser General Public License for more details.
-#
-#You should have received a copy of the GNU Lesser General Public
-#License along with this library; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-###
-
import unittest
import imp
-import os, sys
+import os
+import sys
os.chdir(os.path.dirname(os.path.abspath(__file__)))
Oops, something went wrong.

0 comments on commit f263d9f

Please sign in to comment.