Skip to content

Commit

Permalink
trivial change to setup.py reflecting foobar theme was replaced by ba…
Browse files Browse the repository at this point in the history
…sic theme long ago
  • Loading branch information
RogerHaase committed Dec 13, 2015
0 parents commit be183b8
Show file tree
Hide file tree
Showing 635 changed files with 85,924 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.*\.py[co]$
^dist/
^env/
^env-pypy/
^env-py26/
^env-py27/
^dlc/
^moin.egg-info/
^MoinMoin/_tests/wiki/data/cache/
^wiki/
^wiki_local/
^instance/
^wikiconfig_.+\.py
^MoinMoin/translations/.*/LC_MESSAGES/messages.mo$
^MoinMoin/_tests/wiki/index/
^MoinMoin/themes/modernized/static/css/stylus/normalize.css
^HTML/
^docs/_build/
.coverage
^.project
^.pydevproject
^.settings
^MANIFEST$
.DS_Store
^\.cache/
^\.idea/
.sqlite$
.orig$
.rej$
.~$
^docs/devel/api/modules.rst
^upload.py
^build/
\..*sw[op]$
^activate.bat$
^deactivate.bat$
^moin.bat$
^m.bat$
^activate$
^moin$
^m$
^m-.*\.txt$
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MoinMoin's Copyright and License
================================

Copyright (c) 2000-2006 by Juergen Hermann <jh@web.de>
Copyright (c) 2006-2012 The MoinMoin development team, see
http://moinmo.in/MoinCoreTeamGroup

MoinMoin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

See docs/licenses/COPYING for details.

31 changes: 31 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
include README.txt LICENSE.txt
include quickinstall.py
include wikiconfig.py

recursive-include MoinMoin/translations *

recursive-include MoinMoin/static *
recursive-include MoinMoin/templates *

recursive-include MoinMoin/apps/admin/templates *
recursive-include MoinMoin/apps/misc/templates *

recursive-include MoinMoin/themes/modernized *
recursive-include MoinMoin/themes/foobar *

global-include */_tests/*

recursive-include docs *
recursive-include contrib *
recursive-include wiki *

global-exclude *.orig
global-exclude *.rej

prune docs/_build

prune wiki/data/content
prune wiki/data/userprofiles
prune wiki/data/flask-cache
prune wiki/index

25 changes: 25 additions & 0 deletions MoinMoin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright: 2000-2006 by Juergen Hermann <jh@web.de>
# Copyright: 2002-2011 MoinMoin:ThomasWaldmann
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - a wiki engine in Python.
"""


from __future__ import absolute_import, division

import sys
import platform

from MoinMoin.util.version import Version


project = "MoinMoin"


if sys.hexversion < 0x2070000 or sys.hexversion > 0x2999999:
sys.exit("Error: %s requires Python 2.7.x., current version is %s\n" % (project, platform.python_version()))


version = Version(2, 0, 0, 'a0')
18 changes: 18 additions & 0 deletions MoinMoin/_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright: 2013 MoinMoin:YourNameHere
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - sourcecode header template
Please use this template when starting a new python source file.
It is important that all sourcecode files have the same header structure,
are correctly copyrighted and licensed and have a reasonable docstring
explaining what the module / package does.
Of course you'll have to edit/fix the Copyright line and also the docstring
needs to be replaced with something making sense, but keep the structure.
"""


from __future__ import absolute_import, division
85 changes: 85 additions & 0 deletions MoinMoin/_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright: 2007 MoinMoin:KarolNowak
# Copyright: 2008 MoinMoin:ThomasWaldmann
# Copyright: 2008, 2010 MoinMoin:ReimarBauer
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - some common code for testing
"""


import socket
from StringIO import StringIO

from flask import g as flaskg

from MoinMoin.constants.contenttypes import CHARSET
from MoinMoin.constants.keys import NAME, CONTENTTYPE
from MoinMoin.items import Item
from MoinMoin.util.crypto import random_string

# Promoting the test user -------------------------------------------
# Usually the tests run as anonymous user, but for some stuff, you
# need more privs...


def become_valid(username=u"ValidUser"):
""" modify flaskg.user to make the user valid.
Note that a valid user will only be in ACL special group "Known", if
we have a user profile for this user as the ACL system will check if
there is a userid for this username.
Thus, for testing purposes (e.g. if you need delete rights), it is
easier to use become_trusted().
"""
flaskg.user.profile[NAME] = [username, ]
flaskg.user.may.names = [username, ] # see security.DefaultSecurityPolicy class
flaskg.user.valid = 1


def become_trusted(username=u"TrustedUser"):
""" modify flaskg.user to make the user valid and trusted, so it is in acl group Trusted """
become_valid(username)
flaskg.user.trusted = True


# Creating and destroying test items --------------------------------

def update_item(name, meta, data):
""" creates or updates an item """
if isinstance(data, unicode):
data = data.encode(CHARSET)
item = flaskg.storage[name]

meta = meta.copy()
if NAME not in meta:
meta[NAME] = [name, ]
if CONTENTTYPE not in meta:
meta[CONTENTTYPE] = u'application/octet-stream'
rev = item.store_revision(meta, StringIO(data), return_rev=True)
return rev


def create_random_string_list(length=14, count=10):
""" creates a list of random strings """
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
return [u"{0}".format(random_string(length, chars)) for counter in range(count)]


def nuke_item(name):
""" complete destroys an item """
item = Item.create(name)
item.destroy()


def check_connection(port, host='127.0.0.1'):
"""
Check if we can make a connection to host:port.
If not, raise Exception with a meaningful msg.
"""
try:
s = socket.create_connection((host, port))
s.shutdown(socket.SHUT_RDWR)
s.close()
except socket.error as err:
raise Exception("connecting to {0}:{1:d}, error: {2!s}".format(host, port, err))
74 changes: 74 additions & 0 deletions MoinMoin/_tests/_test_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright: 2003-2004 by Juergen Hermann <jh@web.de>
# Copyright: 2007 MoinMoin:AlexanderSchremmer
# Copyright: 2009 MoinMoin:ReimarBauer
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - MoinMoin.module_tested Tests
Module names must start with 'test_' to be included in the tests.
"""


# include here the module that you want to test:
from MoinMoin import module_tested


class TestSimpleStuff(object):
""" The simplest MoinMoin test class
Class name must start with 'Test' to be included in
the tests.
See http://codespeak.net/py/dist/test.html for reference.
"""
def testSimplest(self):
""" module_tested: test description...
Function name MUST start with 'test' to be included in the
tests.
"""
result = module_tested.some_function('test_value')
expected = 'expected value'
assert result == expected


class TestComplexStuff(object):
""" Describe these tests here...
Some tests may have a list of tests related to this test case. You
can add a test by adding another line to this list
"""
_tests = (
# description, test, expected
('Line break', '<<BR>>', '<br>'),
)

from MoinMoin._tests import wikiconfig

class Config(wikiconfig.Config):
foo = 'bar' # we want to have this non-default setting

def setup_class(self):
""" Stuff that should be run to init the state of this test class
"""

def teardown_class(self):
""" Stuff that should run to clean up the state of this test class
"""

def testFunction(self):
""" module_tested: function should... """
for description, test, expected in self._tests:
result = self._helper_function(test)
assert result == expected

def _helper_fuction(self, test):
""" Some tests needs extra work to run
Keep the test non interesting details out of the way.
"""
module_tested.do_this()
module_tested.do_that()
result = None
return result
Loading

0 comments on commit be183b8

Please sign in to comment.