Fixed things in wiki repo so reST decumentation conversion don't hickup as much.

This commit is contained in:
Griatch 2011-09-11 03:24:41 +02:00
parent daa327877c
commit 22b23be095
24 changed files with 148 additions and 203 deletions

View file

@ -14,14 +14,8 @@ Installation and Early Life
Evennia <StartStopReload.html>`_ Evennia <StartStopReload.html>`_
- `Keeping your game up to date <UpdatingYourGame.html>`_ - `Keeping your game up to date <UpdatingYourGame.html>`_
- `Change Evennia's language <Internationalization.html>`_ - `Change Evennia's language <Internationalization.html>`_
<wiki:comment>
- `Collaborate with others using version - `Collaborate with others using version
control <StaffVersionControl.html>`_ control <StaffVersionControl.html>`_ (not updated)
</wiki:comment>
- `Apache Configuration <ApacheConfig.html>`_ (optional) - `Apache Configuration <ApacheConfig.html>`_ (optional)
- `Text encodings <TextEncodings.html>`_ used when connecting to - `Text encodings <TextEncodings.html>`_ used when connecting to
Evennia Evennia

View file

@ -1,5 +1,3 @@
: Using the Evennia batch code processor
The Batch-Code processor The Batch-Code processor
======================== ========================

View file

@ -1,5 +1,3 @@
: Using the Evennia command batch processors
The Batch-Command processor The Batch-Command processor
=========================== ===========================

View file

@ -2,7 +2,7 @@ Giving permissions to your staff
================================ ================================
*OBS: This gives only a brief introduction to the access system. Locks *OBS: This gives only a brief introduction to the access system. Locks
and permissions are fully detailed `here <Locks.html>`_.* and permissions are fully detailed* `here <Locks.html>`_.
The super user The super user
-------------- --------------

View file

@ -1,9 +1,7 @@
Putting Colour to your game Putting Colour to your game
=========================== ===========================
<wiki:comment> </wiki:comment> *Note that the Docs does not display colour the way it would look on the
*Note that the Wiki does not display colour the way it would look on the
screen.* screen.*
Evennia supports the ``ANSI`` standard for displaying text. This means Evennia supports the ``ANSI`` standard for displaying text. This means

View file

@ -1,5 +1,3 @@
Details on how to use and extend the command system.
Command system Command system
============== ==============

View file

@ -1,109 +1,86 @@
<wiki:toc max*depth*
"3" />
======
Communications Communications
==============
Apart from moving around in the game world and talking, players might Apart from moving around in the game world and talking, players might
need other forms of communication. This is offered by Evennia's ``Comm`` need other forms of communication. This is offered by Evennia's ``Comm``
system. Stock evennia implements a 'MUX-like system. Stock evennia implements a 'MUX-like' system of channels, but
there is nothing stopping you from changing things to better suit your
taste.
:: Comms rely on two main database objects - ``Msg`` and ``Channel``.
system of channels, but there is nothing stopping you from changing things to better suit your taste. Comms rely on two main database objects -
Msg``and``Channel
::
. == Msg ==The
Msg Msg
---
The ``Msg`` object is the basic unit of communication in Evennia. A
message works a little like an e-mail; it always has a sender (a
`Player <Players.html>`_) and one or more recipients. The recipients may
be either other Players, or a *Channel* (see below). You can mix
recipients to send the message to both Channels and Players if you like.
Once created, a ``Msg`` is normally not changed. It is peristently saved
in the database. This allows for comprehensive logging of
communications, both in channels, but also for allowing
senders/receivers to have 'mailboxes' with the messages they want to
keep.
Properties defined on ``Msg``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ``sender`` - this is a reference to a unique `Player <Players.html>`_
object sending the message.
- ``receivers`` - a list of target `Players <Players.html>`_ to send
to.
- ``channels`` - a list of target Channels to send to.
- ``message`` - the actual text being sent
- ``date_sent`` - when message was sent.
- ``locks`` - a `lock definition <Locks.html>`_.
The following is currently unimplemented in Evennia (stay tuned):
- hide*from*sender - bool if message should be hidden from sender
- hide*from*receivers - list of receiver objects to hide message from
- hide*from*channels - list of channels objects to hide message from
You create new messages in code using
``src.utils.create.create_message.``
!TempMsg
~~~~~~~~
``src.objects.models`` contains a class called ``TempMsg`` that mimics a
``Msg`` but does not get saved to the database and do not require a
sender object of a certain type. It's not used by default, but you could
use it in code to send one-off messages to systems expecting a ``Msg``.
Channels
--------
Channels act as generic distributors of messages. Players *subscribe* to
channels and can then send and receive message from it. Channels have
`Locks <Locks.html>`_ to limit who may join them.
There are three default channels created in stock Evennia - ``MUDinfo``,
``MUDconnections`` and ``Public``. Two first ones are server-related
messages meant for Admins, the last one is open to everyone to chat on
(all new players are automatically joined to it when logging in, useful
for asking questions).
You create new channels with ``src.utils.create.create_channel()``.
In code, messages are sent to a channel using the
``msg(message, from_obj=None)`` method. The argument ``message`` can
either be a previously constructed ``Msg`` object or a message string.
If you send a text string, you should usually also define ``from_obj``;
a ``Msg`` object will then be created for you behind the scenes. If you
don't supply ``from_obj``, just the string will be sent to the channel
and nothing will be stored in the database (could be useful for certain
spammy error messages). You can also use ``channel.tempmsg()`` to always
send a non-persistent message, also if you send it a ``Msg`` object.
:: ::
object is the basic unit of communication in Evennia. A message works a little like an e-mail; it always has a sender (a [Players Player]) and one or more recipients. The recipients may be either other Players, or a _Channel_ (see below). You can mix recipients to send the message to both Channels and Players if you like.Once created, a # assume we have a 'sender' object and a channel named 'mychan'# send and store in database from src.utils import create mymsg = create.create_message(sender, "Hello!", channels=[mychan]) mychan.msg(mymsg)# send a one-time message mychan.msg("Hello!")# send a one-time message created from a Msg object mychan.tempmsg(mymsg)
Msg
::
is normally not changed. It is peristently saved in the database. This allows for comprehensive logging of communications, both in channels, but also for allowing senders/receivers to have 'mailboxes' with the messages they want to keep. === Properties defined on
Msg
::
=== *
sender
::
- this is a reference to a unique [Players Player] object sending the message. *
receivers
::
- a list of target [Players] to send to. *
channels
::
- a list of target Channels to send to. *
message
::
- the actual text being sent *
datesent
::
- when message was sent. *
locks
::
- a [Locks lock definition]. The following is currently unimplemented in Evennia (stay tuned): * hide_from_sender - bool if message should be hidden from sender * hide_from_receivers - list of receiver objects to hide message from * hide_from_channels - list of channels objects to hide message fromYou create new messages in code using
src.utils.create.create*message.*
::
===!TempMsg===
src.objects.models``contains a class called``TempMsg``that mimics a``Msg``but does not get saved to the database and do not require a sender object of a certain type. It's not used by default, but you could use it in code to send one-off messages to systems expecting a``Msg
::
.== Channels == Channels act as generic distributors of messages. Players _subscribe_ to channels and can then send and receive message from it. Channels have [Locks] to limit who may join them. There are three default channels created in stock Evennia -
MUDinfo``,``MUDconnections``and``Public
::
. Two first ones are server-related messages meant for Admins, the last one is open to everyone to chat on (all new players are automatically joined to it when logging in, useful for asking questions). You create new channels with
src.utils.create.createchannel()
::
.In code, messages are sent to a channel using the
msg(message, fromobj
None)``method. The argument``message``can either be a previously constructed``Msg``object or a message string. If you send a text string, you should usually also define``fromobj``; a``Msg``object will then be created for you behind the scenes. If you don't supply``from\_obj``, just the string will be sent to the channel and nothing will be stored in the database (could be useful for certain spammy error messages). You can also use``channel.tempmsg()``to always send a non-persistent message, also if you send it a``Msg
::
object.# assume we have a 'sender' object and a channel named 'mychan'# send and store in database from src.utils import create mymsg = create.create_message(sender, "Hello!", channels=[mychan]) mychan.msg(mymsg)# send a one-time message mychan.msg("Hello!")# send a one-time message created from a Msg object mychan.tempmsg(mymsg)
As a more advanced note, sending text to channels is a "special As a more advanced note, sending text to channels is a "special
exception" as far as commands are concerned, and you may completely exception" as far as commands are concerned, and you may completely

View file

@ -3,8 +3,15 @@ The Connection Screen
When you first connect to your game you are greeted by Evennia's default When you first connect to your game you are greeted by Evennia's default
connection screen. It welcomes you, gives you the server version and connection screen. It welcomes you, gives you the server version and
tells you how to connect. Effective, but not very exciting. You will tells you how to connect.
most likely want to change this to be more unique for your game.
::
==============================================================
Welcome to Evennia, version SVN-Alpha! If you have an existing account, connect to it by typing: connect <email> <password> If you need to create an account, type (without the <>'s): create "<username>" <email> <password> Enter help for more info. look will re-show this screen. ==============================================================
Effective, but not very exciting. You will most likely want to change
this to be more unique for your game.
You can customize the connection screen easily. If you look in You can customize the connection screen easily. If you look in
``game/gamesrc/world`` you will find a module named ``game/gamesrc/world`` you will find a module named

View file

@ -1,17 +1,22 @@
Contributing to Evennia
=======================
Wanna help out? Great! Here's how. Wanna help out? Great! Here's how.
Contributing with Documentation Contributing with Documentation
=============================== -------------------------------
Evennia depends heavily on good documentation and we are always looking Evennia depends heavily on good documentation and we are always looking
for extra eyes and hands to improve it. Even a small thing such as for extra eyes and hands to improve it. Even small things such as fixing
fixing typos is a great help. typos is a great help.
Contributing with Code Contributing with Code through a clone repository
====================== -------------------------------------------------
Code sharing with Clone repository We always need more eyes and hands on the code. Even if you don't feel
---------------------------------- confident with tackling any major bugs or features, just correcting
typos, adjusting formatting or simply using the thing helps us a lot in
improving things.
The most elegant way to contribute code to Evennia is to use Mercurial The most elegant way to contribute code to Evennia is to use Mercurial
to create an online *clone* of the Evennia repository and make your to create an online *clone* of the Evennia repository and make your
@ -43,11 +48,12 @@ changes to that. .
From your online repo, Evennia devs can then, assuming the change is From your online repo, Evennia devs can then, assuming the change is
deemed good, pick and merge your work into Evennia proper. deemed good, pick and merge your work into Evennia proper.
Patches Contributing with Patches
------- -------------------------
It's recommended to use a clone repository as described above. Otherwise It's recommended to use a clone repository as described above, but for
you are also welcome to submit your suggested Evennia fixes/addendums as small, well isolated things you are also welcome to submit your
suggested Evennia fixes/addendums as
`patches <https://secure.wikimedia.org/wikipedia/en/wiki/Patch_(computing).html>`_ `patches <https://secure.wikimedia.org/wikipedia/en/wiki/Patch_(computing).html>`_
if you like. Depending on what fits best, post your patch to the `issue if you like. Depending on what fits best, post your patch to the `issue
tracker <https://code.google.com/p/evennia/issues/list.html>`_ or to the tracker <https://code.google.com/p/evennia/issues/list.html>`_ or to the

View file

@ -4,7 +4,7 @@ Commands in Evennia's default command set
========================================= =========================================
*Note: This wiki page is auto-generated from the current status of the *Note: This wiki page is auto-generated from the current status of the
code base and should not be edited manually.*\_ code base and should not be edited manually.*
The commands are ordered after their given help category, which should The commands are ordered after their given help category, which should
usually match a module in ``src/commands/default``. So for example, the usually match a module in ``src/commands/default``. So for example, the

View file

@ -14,17 +14,13 @@ General Evennia development information
--------------------------------------- ---------------------------------------
- `Evennia Licensing FAQ <Licensing.html>`_ - `Evennia Licensing FAQ <Licensing.html>`_
- `Contributing code to Evennia <Contributing.html>`_ - `Contributing to Evennia <Contributing.html>`_
- `Evennia Code Style - `Evennia Code Style
Guide <http://evennia.googlecode.com/svn/trunk/CODING_STYLE>`_ Guide <http://evennia.googlecode.com/svn/trunk/CODING_STYLE>`_
(Important!) (Important!)
- `Policy for 'MUX-like' default commands <UsingMUXAsAStandard.html>`_ - `Policy for 'MUX-like' default commands <UsingMUXAsAStandard.html>`_
- `Setting up a Bazaar environment for coding <BazaarDevel.html>`_ (not
<wiki:comment> updated)
- `Setting up a Bazaar environment for coding <BazaarDevel.html>`_
</wiki:comment>
Evennia Component Documentation Evennia Component Documentation
------------------------------- -------------------------------

View file

@ -1,13 +1,10 @@
Summary of changes in devel-branch Summary of changes in devel-branch
<wiki:toc max\_depth *Note: The devel branch merged with trunk as of r970 (aug2010). So if
you are new to Evennia, this page is of no real interest to you.*
"3" />
*Note: The devel branch merged with trunk as of r970. So if you are new
to Evennia, this page is of no real interest to you.*
Introduction Introduction
============
The Evennia that has been growing in trunk for the last few years is a The Evennia that has been growing in trunk for the last few years is a
wonderful piece of software, with which you can do very nice coding wonderful piece of software, with which you can do very nice coding
@ -37,7 +34,8 @@ report bugs, you can get it from the *griatch* branch with
``svn checkout http://evennia.googlecode.com/svn/branches/griatch evennia-devel`` ``svn checkout http://evennia.googlecode.com/svn/branches/griatch evennia-devel``
Concepts changed from trunk to devel= Concepts changed from trunk to devel
====================================
Script parent -> Typeclasses Script parent -> Typeclasses
---------------------------- ----------------------------

View file

@ -1,9 +1,5 @@
<wiki:toc max\_depth The ``@py`` command
===================
"3" />
======
The ``@py`` command =
The ``@py`` command supplied with the default command set of Evennia The ``@py`` command supplied with the default command set of Evennia
allows you to execute Python commands directly from inside the game. An allows you to execute Python commands directly from inside the game. An

View file

@ -1,5 +1,3 @@
Introduction to and configuration for IMC2.
IMC2 IMC2
==== ====
@ -74,8 +72,6 @@ You should join the channel automatically.
Setting up a Channel ``<->`` IMC2 binding Setting up a Channel ``<->`` IMC2 binding
----------------------------------------- -----------------------------------------
=
Evennia developers have an open-access IMC channel called ``ievennia`` Evennia developers have an open-access IMC channel called ``ievennia``
on ``Server01`` of the Mudbytes network. For Evennia development we on ``Server01`` of the Mudbytes network. For Evennia development we
recommend you connect to this for sharing evennia anecdotes! recommend you connect to this for sharing evennia anecdotes!

View file

@ -14,12 +14,8 @@ internet connection. For IRC operation you also need
is available simply as a package *python-twisted-words* in many Linux is available simply as a package *python-twisted-words* in many Linux
distros, or directly downloadable from the link. distros, or directly downloadable from the link.
<wiki:toc max\_depth Configuring IRC
---------------
"3" />
======
Configuring IRC =
To configure IRC, you'll need to activate it in your settings file. You To configure IRC, you'll need to activate it in your settings file. You
do this by copying the ``IRC_ENABLED`` flag from do this by copying the ``IRC_ENABLED`` flag from

View file

@ -1,33 +1,30 @@
Evennia Licence Evennia Licence FAQ
=============== ===================
Evennia is licensed under the very friendly *Modified Clarified Artistic Evennia is licensed under the very friendly *Modified Clarified Artistic
License*. You can find the license as ``LICENCE`` in the Evennia root License*. You can find the license as ``LICENCE`` in the Evennia root
directory. You can also read the full license file directory. You can also read the full license file
`here <http://code.google.com/p/evennia/source/browse/trunk/LICENSE>`_. `here <http://code.google.com/p/evennia/source/browse/trunk/LICENSE>`_.
Licence FAQ
-----------
You should read the full license file to know what it says exactly, but You should read the full license file to know what it says exactly, but
here are some answers to common questions. here are some answers to common questions.
Q: I have created a game using Evennia, what does the license allow me Q: When creating a game using Evennia, what does the licence permit me
to do with it? to do with it?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------------------------------------------------------------------
**A:** It's your own world to do with what you please! In summary, a **A:** It's your own world to do with as you please! To summarize, a MUD
MU``*`` world you create using Evennia (i.e. the files you create in world you create using Evennia (i.e. the files you create in ``game``)
``game``) falls under **§6** of the license (it's a sort of "library"). falls under **§6** of the license (it's a sort of "library"). So your
So your game world and all its contents belongs to you (as it should game world and all its contents belongs to you (as it should be). Keep
be). Keep it to yourself or re-distribute it under any license of your it to yourself or re-distribute it under any license of your choice - or
choice - or sell it and become filthy rich for all we care. sell it and become filthy rich for all we care.
Q: I have modified Evennia itself, what does the license say about that? Q: I have modified Evennia itself, what does the license say about that?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------
**A:** The Evennia package itself (i.e. the stuff you download from us) **A:** The Evennia package itself (i.e. the stuff you download from us)
is referred to as "The Package", "Standard version" in the license. is referred to as "The Package, Standard version" in the license.
- If you just fixed a typo or bug, that falls under **§2** - that is, - If you just fixed a typo or bug, that falls under **§2** - that is,
you don't *have* to do anything to appease the license. Regardless, you don't *have* to do anything to appease the license. Regardless,
@ -42,7 +39,7 @@ is referred to as "The Package", "Standard version" in the license.
developer! developer!
Q: Can I re-distribute Evennia along with my custom game implementation? Q: Can I re-distribute Evennia along with my custom game implementation?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------
**A:** Sure. This is covered in **§4** - just package the "Standard **A:** Sure. This is covered in **§4** - just package the "Standard
version" (that is, the one you download from us) with your package. Make version" (that is, the one you download from us) with your package. Make

View file

@ -22,6 +22,8 @@ Evennia links
Third-party Evennia links Third-party Evennia links
------------------------- -------------------------
- `Read Evennia's manual on
ReadTheDocs <http://evennia.readthedocs.org>`_
- `Hosting Evennia on - `Hosting Evennia on
Webfaction <http://lotek.heavy.ch/evennia#Hosting>`_ Webfaction <http://lotek.heavy.ch/evennia#Hosting>`_
- `Evennia on Ohloh <http://www.ohloh.net/projects/6906>`_ - `Evennia on Ohloh <http://www.ohloh.net/projects/6906>`_

View file

@ -1,9 +1,5 @@
<wiki:toc max\_depth Locks
=====
"3" />
======
Locks =
For most games it is a good idea to restrict what people can do. In For most games it is a good idea to restrict what people can do. In
Evennia such restrictions are applied and checked by something called Evennia such restrictions are applied and checked by something called

View file

@ -1,9 +1,5 @@
<wiki:toc max\_depth Players
=======
"3" />
======
Players=
All users (in the sense of actual people) connecting to Evennia are All users (in the sense of actual people) connecting to Evennia are
doing so through an object called *Player*. The Player object has no doing so through an object called *Player*. The Player object has no

View file

@ -1,6 +1,3 @@
A brief explanation of what MUSH softcode is and why we use Python
instead.
On MUX and Softcode: A brief overview On MUX and Softcode: A brief overview
===================================== =====================================

View file

@ -17,7 +17,7 @@ class methods that you shouldn't edit.
Properties available to all typeclassed entities (Players, Objects, Properties available to all typeclassed entities (Players, Objects,
Scripts) Scripts)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ----------------------------------------------------------------------------
- ``key`` - the main identifier for the entity, say 'Rose', 'myscript' - ``key`` - the main identifier for the entity, say 'Rose', 'myscript'
or 'Paul'. ``name`` is an alias that can also be used. or 'Paul'. ``name`` is an alias that can also be used.
@ -46,7 +46,7 @@ properties. Go to the pages for `Objects <Objects.html>`_,
more info. more info.
Things to remember when using TypeClasses Things to remember when using TypeClasses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----------------------------------------
Typeclasses mostly behave like normal Python classes - you can Typeclasses mostly behave like normal Python classes - you can
add/overload custom methods and inherit your own classes from them - add/overload custom methods and inherit your own classes from them -
@ -132,7 +132,7 @@ object itself. They are covered in a separate entry
`here <Attributes.html>`_. `here <Attributes.html>`_.
Why split it like this? Why split it like this?
~~~~~~~~~~~~~~~~~~~~~~~ -----------------------
The *Database model* (Django model) allows for saving data to the The *Database model* (Django model) allows for saving data to the
database and is a great place for storing persistent data an object database and is a great place for storing persistent data an object
@ -219,7 +219,7 @@ Another example:
:align: center :align: center
:alt: :alt:
Caveats of the typeclass system Caveats of the typeclass system
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------------------------
While there are many advantages to the typeclass system over working While there are many advantages to the typeclass system over working
with Django models directly, there are also some caveats to remember. with Django models directly, there are also some caveats to remember.

View file

@ -1,5 +1,3 @@
Using and writing unit tests for Evennia.
Unit Testing Unit Testing
============ ============

View file

@ -1,11 +1,7 @@
Workshop: Default-game whitepage Workshop: Default-game whitepage
<wiki:toc max\_depth Introduction
============
"3" />
======
Introduction =
This is an initiative to create a "base" game system to be shipped with This is an initiative to create a "base" game system to be shipped with
Evennia in a "contrib" folder. The game is an independent Evennia in a "contrib" folder. The game is an independent

View file

@ -21,7 +21,7 @@
# 3) Retrieve wiki files (*.wiki) from Google code by mercurial. Make sure # 3) Retrieve wiki files (*.wiki) from Google code by mercurial. Make sure
# to retrieve them into a directory wikiconvert/wiki: # to retrieve them into a directory wikiconvert/wiki:
# #
# hg clone https://code.google.com/p/evennia/wiki wiki # hg clone https://code.google.com/p/evennia.wiki wiki
# #
# 4) Check so that you have the following file structure: # 4) Check so that you have the following file structure:
# #
@ -65,6 +65,7 @@ def wiki2rest():
""" """
Convert from wikifile to rst file, going through html Convert from wikifile to rst file, going through html
""" """
# convert from wikifile to html with wiki2html # convert from wikifile to html with wiki2html
subprocess.call([RUBY_EXE, "wiki_convertor.rb", WIKI_DIR, HTML_DIR], cwd=WIKI2HTML_DIR) subprocess.call([RUBY_EXE, "wiki_convertor.rb", WIKI_DIR, HTML_DIR], cwd=WIKI2HTML_DIR)
@ -77,9 +78,13 @@ def wiki2rest():
htmlfilename = os.path.join(HTML_DIR, filename) htmlfilename = os.path.join(HTML_DIR, filename)
string = "".join(open(htmlfilename, 'r').readlines()) string = "".join(open(htmlfilename, 'r').readlines())
string = re.sub(r'<p class="summary">[A-Za-z0-9 ]*</p>', "", string) string = re.sub(r'<p class="summary">[A-Za-z0-9 .-\:]*</p>', "", string)
string = re.sub(r"&lt;wiki:toc max_depth=&quot;[0-9]&quot; /&gt;", "", string) string = re.sub(r"&lt;wiki:toc max_depth=&quot;[0-9]*&quot; /&gt;", "", string)
string = re.sub(r"&lt;wiki:toc max_depth<h1>&quot;[0-9]*&quot; /&gt;</h1>", "", string)
string = re.sub(r"<p>#settings Featured</p>", "", string) string = re.sub(r"<p>#settings Featured</p>", "", string)
string = re.sub(r'<p class="labels">Featured</p>', "", string)
string = re.sub(r'&lt;wiki:comment&gt;', "", string)
string = re.sub(r'&lt;/wiki:comment&gt;', "", string)
#string = re.sub(r'&lt;wiki:comment&gt;[<>;a-zA\/\n-&Z0-9 ]*&lt;/wiki:comment&gt;', "", string) #string = re.sub(r'&lt;wiki:comment&gt;[<>;a-zA\/\n-&Z0-9 ]*&lt;/wiki:comment&gt;', "", string)
f = open(htmlfilename, 'w') f = open(htmlfilename, 'w')
f.write(string) f.write(string)