OSDN Git Service

git-svn-id: https://svn.osdn.net/svnroot/pydun/trunk@1 44a3fe10-d6a8-4042-99bc-5bf971...
authorhrwatahiki <hrwatahiki@44a3fe10-d6a8-4042-99bc-5bf971f0e03b>
Wed, 20 Mar 2013 05:02:54 +0000 (05:02 +0000)
committerhrwatahiki <hrwatahiki@44a3fe10-d6a8-4042-99bc-5bf971f0e03b>
Wed, 20 Mar 2013 05:02:54 +0000 (05:02 +0000)
37 files changed:
LICENSE.txt [new file with mode: 0644]
LICENSE_PySide.txt [new file with mode: 0644]
LICENSE_PyYAML.txt [new file with mode: 0644]
LICENSE_Python.txt [new file with mode: 0644]
Pydun.py [new file with mode: 0644]
help/index.html [new file with mode: 0644]
images/wall_00.pdn [new file with mode: 0644]
images/wall_01.pdn [new file with mode: 0644]
images/wall_02.pdn [new file with mode: 0644]
images/wall_03_04.pdn [new file with mode: 0644]
images/wall_05.pdn [new file with mode: 0644]
images/wall_06.pdn [new file with mode: 0644]
images/wall_07.pdn [new file with mode: 0644]
images/wall_08.pdn [new file with mode: 0644]
images/wall_09.pdn [new file with mode: 0644]
images/wall_h_00.png [new file with mode: 0644]
images/wall_h_01.png [new file with mode: 0644]
images/wall_h_02.png [new file with mode: 0644]
images/wall_h_03.png [new file with mode: 0644]
images/wall_h_04.png [new file with mode: 0644]
images/wall_h_05.png [new file with mode: 0644]
images/wall_h_06.png [new file with mode: 0644]
images/wall_h_07.png [new file with mode: 0644]
images/wall_h_08.png [new file with mode: 0644]
images/wall_h_09.png [new file with mode: 0644]
images/wall_v_00.png [new file with mode: 0644]
images/wall_v_01.png [new file with mode: 0644]
images/wall_v_02.png [new file with mode: 0644]
images/wall_v_03.png [new file with mode: 0644]
images/wall_v_04.png [new file with mode: 0644]
images/wall_v_05.png [new file with mode: 0644]
images/wall_v_06.png [new file with mode: 0644]
images/wall_v_07.png [new file with mode: 0644]
images/wall_v_08.png [new file with mode: 0644]
images/wall_v_09.png [new file with mode: 0644]
makeexe.bat [new file with mode: 0644]
pydun.exe [new file with mode: 0644]

diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644 (file)
index 0000000..e6b5506
--- /dev/null
@@ -0,0 +1,52 @@
+pydun.py はMIT Licenseです。要約すると、自由に使っていいですが無保証です。\r
+\r
+ライセンス本文\r
+--------------------------------------------------------------------------------\r
+Copyright (c) 2013 WATAHIKI Hiroyuki\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+this software and associated documentation files (the "Software"), to deal in\r
+the Software without restriction, including without limitation the rights to\r
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
+of the Software, and to permit persons to whom the Software is furnished to do\r
+so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in all\r
+copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+SOFTWARE.\r
+--------------------------------------------------------------------------------\r
+\r
+\r
+pydun.exeは以下のソフトウェアを改変せずに使用しています。\r
+\r
+Python 2.7.3\r
+Copyright 1990-2012, Python Software Foundation.\r
+http://www.python.org/\r
+License: PSF (LICENSE_Python.txt)\r
+\r
+PySide 1.1.2\r
+Author: PySide Team\r
+http://www.pyside.org/\r
+http://qt-project.org/wiki/PySide/\r
+License: LGPL version 2.1 (LICENSE_PySide.txt)\r
+\r
+PyYAML 3.10\r
+Author: Kirill Simonov\r
+http://pyyaml.org/wiki/PyYAML/\r
+License: MIT (LICENSE_PyYAML.txt)\r
+\r
+\r
+また、pydun.exeの実行ファイル作成には以下のソフトウェアを使用しています。\r
+\r
+pyinstaller 2.0\r
+http://www.pyinstaller.org/\r
+\r
+pywin32 Build 218\r
+http://sf.net/projects/pywin32/\r
diff --git a/LICENSE_PySide.txt b/LICENSE_PySide.txt
new file mode 100644 (file)
index 0000000..9315102
--- /dev/null
@@ -0,0 +1,501 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+               Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+          GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+             END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
diff --git a/LICENSE_PyYAML.txt b/LICENSE_PyYAML.txt
new file mode 100644 (file)
index 0000000..050ced2
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2006 Kirill Simonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/LICENSE_Python.txt b/LICENSE_Python.txt
new file mode 100644 (file)
index 0000000..77db08d
--- /dev/null
@@ -0,0 +1,778 @@
+\r
+Python 2.7.3\r
+Copyright 1990-2012, Python Software Foundation.\r
+http://www.python.org/\r
+\r
+A. HISTORY OF THE SOFTWARE\r
+==========================\r
+\r
+Python was created in the early 1990s by Guido van Rossum at Stichting\r
+Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands\r
+as a successor of a language called ABC.  Guido remains Python's\r
+principal author, although it includes many contributions from others.\r
+\r
+In 1995, Guido continued his work on Python at the Corporation for\r
+National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)\r
+in Reston, Virginia where he released several versions of the\r
+software.\r
+\r
+In May 2000, Guido and the Python core development team moved to\r
+BeOpen.com to form the BeOpen PythonLabs team.  In October of the same\r
+year, the PythonLabs team moved to Digital Creations (now Zope\r
+Corporation, see http://www.zope.com).  In 2001, the Python Software\r
+Foundation (PSF, see http://www.python.org/psf/) was formed, a\r
+non-profit organization created specifically to own Python-related\r
+Intellectual Property.  Zope Corporation is a sponsoring member of\r
+the PSF.\r
+\r
+All Python releases are Open Source (see http://www.opensource.org for\r
+the Open Source Definition).  Historically, most, but not all, Python\r
+releases have also been GPL-compatible; the table below summarizes\r
+the various releases.\r
+\r
+    Release         Derived     Year        Owner       GPL-\r
+                    from                                compatible? (1)\r
+\r
+    0.9.0 thru 1.2              1991-1995   CWI         yes\r
+    1.3 thru 1.5.2  1.2         1995-1999   CNRI        yes\r
+    1.6             1.5.2       2000        CNRI        no\r
+    2.0             1.6         2000        BeOpen.com  no\r
+    1.6.1           1.6         2001        CNRI        yes (2)\r
+    2.1             2.0+1.6.1   2001        PSF         no\r
+    2.0.1           2.0+1.6.1   2001        PSF         yes\r
+    2.1.1           2.1+2.0.1   2001        PSF         yes\r
+    2.2             2.1.1       2001        PSF         yes\r
+    2.1.2           2.1.1       2002        PSF         yes\r
+    2.1.3           2.1.2       2002        PSF         yes\r
+    2.2.1           2.2         2002        PSF         yes\r
+    2.2.2           2.2.1       2002        PSF         yes\r
+    2.2.3           2.2.2       2003        PSF         yes\r
+    2.3             2.2.2       2002-2003   PSF         yes\r
+    2.3.1           2.3         2002-2003   PSF         yes\r
+    2.3.2           2.3.1       2002-2003   PSF         yes\r
+    2.3.3           2.3.2       2002-2003   PSF         yes\r
+    2.3.4           2.3.3       2004        PSF         yes\r
+    2.3.5           2.3.4       2005        PSF         yes\r
+    2.4             2.3         2004        PSF         yes\r
+    2.4.1           2.4         2005        PSF         yes\r
+    2.4.2           2.4.1       2005        PSF         yes\r
+    2.4.3           2.4.2       2006        PSF         yes\r
+    2.4.4           2.4.3       2006        PSF         yes\r
+    2.5             2.4         2006        PSF         yes\r
+    2.5.1           2.5         2007        PSF         yes\r
+    2.5.2           2.5.1       2008        PSF         yes\r
+    2.5.3           2.5.2       2008        PSF         yes\r
+    2.6             2.5         2008        PSF         yes\r
+    2.6.1           2.6         2008        PSF         yes\r
+    2.6.2           2.6.1       2009        PSF         yes\r
+    2.6.3           2.6.2       2009        PSF         yes\r
+    2.6.4           2.6.3       2009        PSF         yes\r
+    2.6.5           2.6.4       2010        PSF         yes\r
+    2.7             2.6         2010        PSF         yes\r
+\r
+Footnotes:\r
+\r
+(1) GPL-compatible doesn't mean that we're distributing Python under\r
+    the GPL.  All Python licenses, unlike the GPL, let you distribute\r
+    a modified version without making your changes open source.  The\r
+    GPL-compatible licenses make it possible to combine Python with\r
+    other software that is released under the GPL; the others don't.\r
+\r
+(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,\r
+    because its license has a choice of law clause.  According to\r
+    CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1\r
+    is "not incompatible" with the GPL.\r
+\r
+Thanks to the many outside volunteers who have worked under Guido's\r
+direction to make these releases possible.\r
+\r
+\r
+B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON\r
+===============================================================\r
+\r
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2\r
+--------------------------------------------\r
+\r
+1. This LICENSE AGREEMENT is between the Python Software Foundation\r
+("PSF"), and the Individual or Organization ("Licensee") accessing and\r
+otherwise using this software ("Python") in source or binary form and\r
+its associated documentation.\r
+\r
+2. Subject to the terms and conditions of this License Agreement, PSF hereby\r
+grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,\r
+analyze, test, perform and/or display publicly, prepare derivative works,\r
+distribute, and otherwise use Python alone or in any derivative version,\r
+provided, however, that PSF's License Agreement and PSF's notice of copyright,\r
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\r
+2011, 2012 Python Software Foundation; All Rights Reserved" are retained in Python\r
+alone or in any derivative version prepared by Licensee.\r
+\r
+3. In the event Licensee prepares a derivative work that is based on\r
+or incorporates Python or any part thereof, and wants to make\r
+the derivative work available to others as provided herein, then\r
+Licensee hereby agrees to include in any such work a brief summary of\r
+the changes made to Python.\r
+\r
+4. PSF is making Python available to Licensee on an "AS IS"\r
+basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR\r
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND\r
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS\r
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT\r
+INFRINGE ANY THIRD PARTY RIGHTS.\r
+\r
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\r
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS\r
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,\r
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\r
+\r
+6. This License Agreement will automatically terminate upon a material\r
+breach of its terms and conditions.\r
+\r
+7. Nothing in this License Agreement shall be deemed to create any\r
+relationship of agency, partnership, or joint venture between PSF and\r
+Licensee.  This License Agreement does not grant permission to use PSF\r
+trademarks or trade name in a trademark sense to endorse or promote\r
+products or services of Licensee, or any third party.\r
+\r
+8. By copying, installing or otherwise using Python, Licensee\r
+agrees to be bound by the terms and conditions of this License\r
+Agreement.\r
+\r
+\r
+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0\r
+-------------------------------------------\r
+\r
+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1\r
+\r
+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an\r
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the\r
+Individual or Organization ("Licensee") accessing and otherwise using\r
+this software in source or binary form and its associated\r
+documentation ("the Software").\r
+\r
+2. Subject to the terms and conditions of this BeOpen Python License\r
+Agreement, BeOpen hereby grants Licensee a non-exclusive,\r
+royalty-free, world-wide license to reproduce, analyze, test, perform\r
+and/or display publicly, prepare derivative works, distribute, and\r
+otherwise use the Software alone or in any derivative version,\r
+provided, however, that the BeOpen Python License is retained in the\r
+Software, alone or in any derivative version prepared by Licensee.\r
+\r
+3. BeOpen is making the Software available to Licensee on an "AS IS"\r
+basis.  BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR\r
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND\r
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS\r
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT\r
+INFRINGE ANY THIRD PARTY RIGHTS.\r
+\r
+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE\r
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS\r
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY\r
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\r
+\r
+5. This License Agreement will automatically terminate upon a material\r
+breach of its terms and conditions.\r
+\r
+6. This License Agreement shall be governed by and interpreted in all\r
+respects by the law of the State of California, excluding conflict of\r
+law provisions.  Nothing in this License Agreement shall be deemed to\r
+create any relationship of agency, partnership, or joint venture\r
+between BeOpen and Licensee.  This License Agreement does not grant\r
+permission to use BeOpen trademarks or trade names in a trademark\r
+sense to endorse or promote products or services of Licensee, or any\r
+third party.  As an exception, the "BeOpen Python" logos available at\r
+http://www.pythonlabs.com/logos.html may be used according to the\r
+permissions granted on that web page.\r
+\r
+7. By copying, installing or otherwise using the software, Licensee\r
+agrees to be bound by the terms and conditions of this License\r
+Agreement.\r
+\r
+\r
+CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1\r
+---------------------------------------\r
+\r
+1. This LICENSE AGREEMENT is between the Corporation for National\r
+Research Initiatives, having an office at 1895 Preston White Drive,\r
+Reston, VA 20191 ("CNRI"), and the Individual or Organization\r
+("Licensee") accessing and otherwise using Python 1.6.1 software in\r
+source or binary form and its associated documentation.\r
+\r
+2. Subject to the terms and conditions of this License Agreement, CNRI\r
+hereby grants Licensee a nonexclusive, royalty-free, world-wide\r
+license to reproduce, analyze, test, perform and/or display publicly,\r
+prepare derivative works, distribute, and otherwise use Python 1.6.1\r
+alone or in any derivative version, provided, however, that CNRI's\r
+License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)\r
+1995-2001 Corporation for National Research Initiatives; All Rights\r
+Reserved" are retained in Python 1.6.1 alone or in any derivative\r
+version prepared by Licensee.  Alternately, in lieu of CNRI's License\r
+Agreement, Licensee may substitute the following text (omitting the\r
+quotes): "Python 1.6.1 is made available subject to the terms and\r
+conditions in CNRI's License Agreement.  This Agreement together with\r
+Python 1.6.1 may be located on the Internet using the following\r
+unique, persistent identifier (known as a handle): 1895.22/1013.  This\r
+Agreement may also be obtained from a proxy server on the Internet\r
+using the following URL: http://hdl.handle.net/1895.22/1013".\r
+\r
+3. In the event Licensee prepares a derivative work that is based on\r
+or incorporates Python 1.6.1 or any part thereof, and wants to make\r
+the derivative work available to others as provided herein, then\r
+Licensee hereby agrees to include in any such work a brief summary of\r
+the changes made to Python 1.6.1.\r
+\r
+4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"\r
+basis.  CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR\r
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND\r
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS\r
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT\r
+INFRINGE ANY THIRD PARTY RIGHTS.\r
+\r
+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\r
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS\r
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,\r
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\r
+\r
+6. This License Agreement will automatically terminate upon a material\r
+breach of its terms and conditions.\r
+\r
+7. This License Agreement shall be governed by the federal\r
+intellectual property law of the United States, including without\r
+limitation the federal copyright law, and, to the extent such\r
+U.S. federal law does not apply, by the law of the Commonwealth of\r
+Virginia, excluding Virginia's conflict of law provisions.\r
+Notwithstanding the foregoing, with regard to derivative works based\r
+on Python 1.6.1 that incorporate non-separable material that was\r
+previously distributed under the GNU General Public License (GPL), the\r
+law of the Commonwealth of Virginia shall govern this License\r
+Agreement only as to issues arising under or with respect to\r
+Paragraphs 4, 5, and 7 of this License Agreement.  Nothing in this\r
+License Agreement shall be deemed to create any relationship of\r
+agency, partnership, or joint venture between CNRI and Licensee.  This\r
+License Agreement does not grant permission to use CNRI trademarks or\r
+trade name in a trademark sense to endorse or promote products or\r
+services of Licensee, or any third party.\r
+\r
+8. By clicking on the "ACCEPT" button where indicated, or by copying,\r
+installing or otherwise using Python 1.6.1, Licensee agrees to be\r
+bound by the terms and conditions of this License Agreement.\r
+\r
+        ACCEPT\r
+\r
+\r
+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2\r
+--------------------------------------------------\r
+\r
+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,\r
+The Netherlands.  All rights reserved.\r
+\r
+Permission to use, copy, modify, and distribute this software and its\r
+documentation for any purpose and without fee is hereby granted,\r
+provided that the above copyright notice appear in all copies and that\r
+both that copyright notice and this permission notice appear in\r
+supporting documentation, and that the name of Stichting Mathematisch\r
+Centrum or CWI not be used in advertising or publicity pertaining to\r
+distribution of the software without specific, written prior\r
+permission.\r
+\r
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO\r
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\r
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE\r
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\r
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\r
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\r
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\r
+\r
+\r
+Additional Conditions for this Windows binary build\r
+---------------------------------------------------\r
+\r
+This program is linked with and uses Microsoft Distributable Code,\r
+copyrighted by Microsoft Corporation. The Microsoft Distributable Code\r
+includes the following files:\r
+\r
+msvcr90.dll\r
+msvcp90.dll\r
+msvcm90.dll\r
+\r
+If you further distribute programs that include the Microsoft\r
+Distributable Code, you must comply with the restrictions on\r
+distribution specified by Microsoft. In particular, you must require\r
+distributors and external end users to agree to terms that protect the\r
+Microsoft Distributable Code at least as much as Microsoft's own\r
+requirements for the Distributable Code. See Microsoft's documentation\r
+(included in its developer tools and on its website at microsoft.com)\r
+for specific details.\r
+\r
+Redistribution of the Windows binary build of the Python interpreter\r
+complies with this agreement, provided that you do not:\r
+\r
+- alter any copyright, trademark or patent notice in Microsoft's\r
+Distributable Code;\r
+\r
+- use Microsoft's trademarks in your programs' names or in a way that\r
+suggests your programs come from or are endorsed by Microsoft;\r
+\r
+- distribute Microsoft's Distributable Code to run on a platform other\r
+than Microsoft operating systems, run-time technologies or application\r
+platforms; or\r
+\r
+- include Microsoft Distributable Code in malicious, deceptive or\r
+unlawful programs.\r
+\r
+These restrictions apply only to the Microsoft Distributable Code as\r
+defined above, not to Python itself or any programs running on the\r
+Python interpreter. The redistribution of the Python interpreter and\r
+libraries is governed by the Python Software License included with this\r
+file, or by other licenses as marked.\r
+\r
+\r
+This copy of Python includes a copy of bzip2, which is licensed under the following terms:\r
+\r
+\r
+--------------------------------------------------------------------------\r
+\r
+This program, "bzip2", the associated library "libbzip2", and all\r
+documentation, are copyright (C) 1996-2007 Julian R Seward.  All\r
+rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions\r
+are met:\r
+\r
+1. Redistributions of source code must retain the above copyright\r
+   notice, this list of conditions and the following disclaimer.\r
+\r
+2. The origin of this software must not be misrepresented; you must\r
+   not claim that you wrote the original software.  If you use this\r
+   software in a product, an acknowledgment in the product\r
+   documentation would be appreciated but is not required.\r
+\r
+3. Altered source versions must be plainly marked as such, and must\r
+   not be misrepresented as being the original software.\r
+\r
+4. The name of the author may not be used to endorse or promote\r
+   products derived from this software without specific prior written\r
+   permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS\r
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\r
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\r
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+Julian Seward, jseward@bzip.org\r
+bzip2/libbzip2 version 1.0.5 of 10 December 2007\r
+\r
+--------------------------------------------------------------------------\r
+\r
+This copy of Python includes a copy of Berkeley DB, which is licensed under the following terms:\r
+\r
+/*-\r
+ * $Id: LICENSE,v 12.9 2008/02/07 17:12:17 mark Exp $\r
+ */\r
+\r
+The following is the license that applies to this copy of the Berkeley DB\r
+software.  For a license to use the Berkeley DB software under conditions\r
+other than those described here, or to purchase support for this software,\r
+please contact Oracle at berkeleydb-info_us@oracle.com.\r
+\r
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
+/*\r
+ * Copyright (c) 1990,2008 Oracle.  All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Redistributions in any form must be accompanied by information on\r
+ *    how to obtain complete source code for the DB software and any\r
+ *    accompanying software that uses the DB software.  The source code\r
+ *    must either be included in the distribution or be available for no\r
+ *    more than the cost of distribution plus a nominal fee, and must be\r
+ *    freely redistributable under reasonable conditions.  For an\r
+ *    executable file, complete source code means the source code for all\r
+ *    modules it contains.  It does not include source code for modules or\r
+ *    files that typically accompany the major components of the operating\r
+ *    system on which the executable file runs.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY ORACLE ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR\r
+ * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL ORACLE BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\r
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\r
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+/*\r
+ * Copyright (c) 1990, 1993, 1994, 1995\r
+ *     The Regents of the University of California.  All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the University nor the names of its contributors\r
+ *    may be used to endorse or promote products derived from this software\r
+ *    without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ */\r
+/*\r
+ * Copyright (c) 1995, 1996\r
+ *     The President and Fellows of Harvard University.  All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the University nor the names of its contributors\r
+ *    may be used to endorse or promote products derived from this software\r
+ *    without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ */\r
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
+/***\r
+ * ASM: a very small and fast Java bytecode manipulation framework\r
+ * Copyright (c) 2000-2005 INRIA, France Telecom\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the copyright holders nor the names of its\r
+ *    contributors may be used to endorse or promote products derived from\r
+ *    this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r
+ * THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+This copy of Python includes a copy of openssl, which is licensed under the following terms:\r
+\r
+\r
+  LICENSE ISSUES\r
+  ==============\r
+\r
+  The OpenSSL toolkit stays under a dual license, i.e. both the conditions of\r
+  the OpenSSL License and the original SSLeay license apply to the toolkit.\r
+  See below for the actual license texts. Actually both licenses are BSD-style\r
+  Open Source licenses. In case of any license issues related to OpenSSL\r
+  please contact openssl-core@openssl.org.\r
+\r
+  OpenSSL License\r
+  ---------------\r
+\r
+/* ====================================================================\r
+ * Copyright (c) 1998-2008 The OpenSSL Project.  All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in\r
+ *    the documentation and/or other materials provided with the\r
+ *    distribution.\r
+ *\r
+ * 3. All advertising materials mentioning features or use of this\r
+ *    software must display the following acknowledgment:\r
+ *    "This product includes software developed by the OpenSSL Project\r
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"\r
+ *\r
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to\r
+ *    endorse or promote products derived from this software without\r
+ *    prior written permission. For written permission, please contact\r
+ *    openssl-core@openssl.org.\r
+ *\r
+ * 5. Products derived from this software may not be called "OpenSSL"\r
+ *    nor may "OpenSSL" appear in their names without prior written\r
+ *    permission of the OpenSSL Project.\r
+ *\r
+ * 6. Redistributions of any form whatsoever must retain the following\r
+ *    acknowledgment:\r
+ *    "This product includes software developed by the OpenSSL Project\r
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\r
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\r
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\r
+ * OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ * ====================================================================\r
+ *\r
+ * This product includes cryptographic software written by Eric Young\r
+ * (eay@cryptsoft.com).  This product includes software written by Tim\r
+ * Hudson (tjh@cryptsoft.com).\r
+ *\r
+ */\r
+\r
+ Original SSLeay License\r
+ -----------------------\r
+\r
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\r
+ * All rights reserved.\r
+ *\r
+ * This package is an SSL implementation written\r
+ * by Eric Young (eay@cryptsoft.com).\r
+ * The implementation was written so as to conform with Netscapes SSL.\r
+ *\r
+ * This library is free for commercial and non-commercial use as long as\r
+ * the following conditions are aheared to.  The following conditions\r
+ * apply to all code found in this distribution, be it the RC4, RSA,\r
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\r
+ * included with this distribution is covered by the same copyright terms\r
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).\r
+ *\r
+ * Copyright remains Eric Young's, and as such any Copyright notices in\r
+ * the code are not to be removed.\r
+ * If this package is used in a product, Eric Young should be given attribution\r
+ * as the author of the parts of the library used.\r
+ * This can be in the form of a textual message at program startup or\r
+ * in documentation (online or textual) provided with the package.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ *    must display the following acknowledgement:\r
+ *    "This product includes cryptographic software written by\r
+ *     Eric Young (eay@cryptsoft.com)"\r
+ *    The word 'cryptographic' can be left out if the rouines from the library\r
+ *    being used are not cryptographic related :-).\r
+ * 4. If you include any Windows specific code (or a derivative thereof) from\r
+ *    the apps directory (application code) you must include an acknowledgement:\r
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ *\r
+ * The licence and distribution terms for any publically available version or\r
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be\r
+ * copied and put under another distribution licence\r
+ * [including the GNU Public Licence.]\r
+ */\r
+\r
+\r
+This copy of Python includes a copy of Tcl, which is licensed under the following terms:\r
+\r
+This software is copyrighted by the Regents of the University of\r
+California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState\r
+Corporation and other parties.  The following terms apply to all files\r
+associated with the software unless explicitly disclaimed in\r
+individual files.\r
+\r
+The authors hereby grant permission to use, copy, modify, distribute,\r
+and license this software and its documentation for any purpose, provided\r
+that existing copyright notices are retained in all copies and that this\r
+notice is included verbatim in any distributions. No written agreement,\r
+license, or royalty fee is required for any of the authorized uses.\r
+Modifications to this software may be copyrighted by their authors\r
+and need not follow the licensing terms described here, provided that\r
+the new terms are clearly indicated on the first page of each file where\r
+they apply.\r
+\r
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY\r
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\r
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY\r
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGE.\r
+\r
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,\r
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE\r
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE\r
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR\r
+MODIFICATIONS.\r
+\r
+GOVERNMENT USE: If you are acquiring this software on behalf of the\r
+U.S. government, the Government shall have only "Restricted Rights"\r
+in the software and related documentation as defined in the Federal\r
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you\r
+are acquiring the software on behalf of the Department of Defense, the\r
+software shall be classified as "Commercial Computer Software" and the\r
+Government shall have only "Restricted Rights" as defined in Clause\r
+252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the\r
+authors grant the U.S. Government and others acting in its behalf\r
+permission to use and distribute the software in accordance with the\r
+terms specified in this license.\r
+\r
+This copy of Python includes a copy of Tk, which is licensed under the following terms:\r
+\r
+This software is copyrighted by the Regents of the University of\r
+California, Sun Microsystems, Inc., and other parties.  The following\r
+terms apply to all files associated with the software unless explicitly\r
+disclaimed in individual files.\r
+\r
+The authors hereby grant permission to use, copy, modify, distribute,\r
+and license this software and its documentation for any purpose, provided\r
+that existing copyright notices are retained in all copies and that this\r
+notice is included verbatim in any distributions. No written agreement,\r
+license, or royalty fee is required for any of the authorized uses.\r
+Modifications to this software may be copyrighted by their authors\r
+and need not follow the licensing terms described here, provided that\r
+the new terms are clearly indicated on the first page of each file where\r
+they apply.\r
+\r
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY\r
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\r
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY\r
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGE.\r
+\r
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,\r
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE\r
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE\r
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR\r
+MODIFICATIONS.\r
+\r
+GOVERNMENT USE: If you are acquiring this software on behalf of the\r
+U.S. government, the Government shall have only "Restricted Rights"\r
+in the software and related documentation as defined in the Federal\r
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you\r
+are acquiring the software on behalf of the Department of Defense, the\r
+software shall be classified as "Commercial Computer Software" and the\r
+Government shall have only "Restricted Rights" as defined in Clause\r
+252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the\r
+authors grant the U.S. Government and others acting in its behalf\r
+permission to use and distribute the software in accordance with the\r
+terms specified in this license.\r
+\r
+This copy of Python includes a copy of Tix, which is licensed under the following terms:\r
+\r
+Copyright (c) 1993-1999 Ioi Kim Lam.\r
+Copyright (c) 2000-2001 Tix Project Group.\r
+Copyright (c) 2004 ActiveState\r
+\r
+This software is copyrighted by the above entities\r
+and other parties.  The following terms apply to all files associated\r
+with the software unless explicitly disclaimed in individual files.\r
+\r
+The authors hereby grant permission to use, copy, modify, distribute,\r
+and license this software and its documentation for any purpose, provided\r
+that existing copyright notices are retained in all copies and that this\r
+notice is included verbatim in any distributions. No written agreement,\r
+license, or royalty fee is required for any of the authorized uses.\r
+Modifications to this software may be copyrighted by their authors\r
+and need not follow the licensing terms described here, provided that\r
+the new terms are clearly indicated on the first page of each file where\r
+they apply.\r
+\r
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY\r
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES\r
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY\r
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGE.\r
+\r
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,\r
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE\r
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE\r
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR\r
+MODIFICATIONS.\r
+\r
+GOVERNMENT USE: If you are acquiring this software on behalf of the\r
+U.S. government, the Government shall have only "Restricted Rights"\r
+in the software and related documentation as defined in the Federal\r
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you\r
+are acquiring the software on behalf of the Department of Defense, the\r
+software shall be classified as "Commercial Computer Software" and the\r
+Government shall have only "Restricted Rights" as defined in Clause\r
+252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the\r
+authors grant the U.S. Government and others acting in its behalf\r
+permission to use and distribute the software in accordance with the\r
+terms specified in this license.\r
+\r
+----------------------------------------------------------------------\r
+\r
+Parts of this software are based on the Tcl/Tk software copyrighted by\r
+the Regents of the University of California, Sun Microsystems, Inc.,\r
+and other parties. The original license terms of the Tcl/Tk software\r
+distribution is included in the file docs/license.tcltk.\r
+\r
+Parts of this software are based on the HTML Library software\r
+copyrighted by Sun Microsystems, Inc. The original license terms of\r
+the HTML Library software distribution is included in the file\r
+docs/license.html_lib.\r
diff --git a/Pydun.py b/Pydun.py
new file mode 100644 (file)
index 0000000..cd0924a
--- /dev/null
+++ b/Pydun.py
@@ -0,0 +1,1280 @@
+#!/usr/bin/env python\r
+# -*- coding: utf-8 -*-\r
+\r
+#Pydun.py - mapping tool\r
+#copyright (c) 2013 WATAHIKI Hiroyuki\r
+#url: http://sourceforge.jp/projects/pydun/\r
+#email: hrwatahiki at gmail.com\r
+\r
+\r
+import sys\r
+import os.path\r
+import codecs\r
+import webbrowser\r
+from PySide import QtCore, QtGui\r
+import yaml\r
+\r
+\r
+_mapengine = None\r
+_mapimages = None\r
+_undomanager = None\r
+\r
+projecturl = "http://sourceforge.jp/projects/pydun/"\r
+projectversion = "1.0.0"\r
+\r
+class MainWindow(QtGui.QMainWindow):\r
+\r
+    def __init__(self, parent=None):\r
+        global _mapengine\r
+        global _mapimages\r
+        global _undomanager\r
+        super(MainWindow, self).__init__(parent)\r
+\r
+        _undomanager = UndoManager()\r
+        _mapimages = MapImages()\r
+        self.setmenu()\r
+        _undomanager.changed.connect(self.updateundostate)\r
+\r
+        if len(sys.argv) <= 2:\r
+            self.new()\r
+        else:\r
+            self.open(sys.argv[2])\r
+\r
+\r
+        self.mainframe = MainFrame(self)\r
+        self.setCentralWidget(self.mainframe)\r
+\r
+        self.statusbar = QtGui.QStatusBar(self)\r
+        self.statusbar.showMessage(u"")\r
+        self.setStatusBar(self.statusbar)\r
+\r
+    def setmenu(self):\r
+        #File menu\r
+        filemenu = self.menuBar().addMenu(u"ファイル(&F)")\r
+\r
+        newact = QtGui.QAction(u"新規(&N)", self)\r
+        newact.triggered.connect(self.new_triggered)\r
+        newact.setShortcut(QtGui.QKeySequence.New)\r
+        filemenu.addAction(newact)\r
+\r
+        openact = QtGui.QAction(u"開く(&O)...", self)\r
+        openact.triggered.connect(self.open_triggered)\r
+        openact.setShortcut(QtGui.QKeySequence.Open)\r
+        filemenu.addAction(openact)\r
+\r
+        saveact = QtGui.QAction(u"保存(&S)", self)\r
+        saveact.triggered.connect(self.save_triggered)\r
+        saveact.setShortcut(QtGui.QKeySequence.Save)\r
+        filemenu.addAction(saveact)\r
+\r
+        saveasact = QtGui.QAction(u"名前をつけて保存(&A)...", self)\r
+        saveasact.triggered.connect(self.saveas_triggered)\r
+        saveasact.setShortcut(QtGui.QKeySequence.SaveAs)\r
+        filemenu.addAction(saveasact)\r
+\r
+        exitact = QtGui.QAction(u"終了(&E)", self)\r
+        exitact.triggered.connect(self.exit_triggered)\r
+        exitact.setShortcut(QtGui.QKeySequence.Quit)\r
+        filemenu.addAction(exitact)\r
+\r
+        #Edit menu\r
+        editmenu = self.menuBar().addMenu(u"編集(&E)")\r
+        self.undoact = QtGui.QAction(u"元に戻す(&U)", self)\r
+        self.undoact.triggered.connect(self.undo_triggered)\r
+        self.undoact.setShortcut(QtGui.QKeySequence.Undo)\r
+        editmenu.addAction(self.undoact)\r
+        self.redoact = QtGui.QAction(u"やり直し(&R)", self)\r
+        self.redoact.triggered.connect(self.redo_triggered)\r
+        self.redoact.setShortcut(QtGui.QKeySequence.Redo)\r
+        editmenu.addAction(self.redoact)\r
+        editmenu.addSeparator()\r
+        setmapsizeact = QtGui.QAction(u"マップのサイズ(&S)", self)\r
+        setmapsizeact.triggered.connect(self.setmapsize_triggered)\r
+        editmenu.addAction(setmapsizeact)\r
+        setorigineact = QtGui.QAction(u"座標設定(&O)", self)\r
+        setorigineact.triggered.connect(self.setorigine_triggered)\r
+        editmenu.addAction(setorigineact)\r
+\r
+        #Help menu\r
+        helpmenu = self.menuBar().addMenu(u"ヘルプ(&H)")\r
+        tutorialact = QtGui.QAction(u"チュートリアル(&T)", self)\r
+        tutorialact.triggered.connect(self.tutorial_triggered)\r
+        tutorialact.setShortcut(QtGui.QKeySequence.HelpContents)\r
+        helpmenu.addAction(tutorialact)\r
+        projectact = QtGui.QAction(u"プロジェクトのWebサイト(&W)", self)\r
+        projectact.triggered.connect(self.project_triggered)\r
+        helpmenu.addAction(projectact)\r
+        aboutact = QtGui.QAction(u"Pydunについて(&A)...", self)\r
+        aboutact.triggered.connect(self.about_triggered)\r
+        helpmenu.addAction(aboutact)\r
+\r
+    @QtCore.Slot(bool, bool)\r
+    def updateundostate(self, canundo, canredo):\r
+        if canundo:\r
+            self.undoact.setEnabled(True)\r
+        else:\r
+            self.undoact.setDisabled(True)\r
+        if canredo:\r
+            self.redoact.setEnabled(True)\r
+        else:\r
+            self.redoact.setDisabled(True)\r
+\r
+    def setTitle(self, fileName):\r
+        if fileName == None:\r
+            s = u"新規作成"\r
+        else:\r
+            s = os.path.basename(fileName)\r
+        s ="Pydun - " + s\r
+        self.setWindowTitle(s)\r
+\r
+    @QtCore.Slot()\r
+    def new_triggered(self):\r
+        if QtGui.QMessageBox.Ok == QtGui.QMessageBox.question(\r
+            self, u"確認", u"新しいマップを作成しますか?",\r
+            (QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)):\r
+            self.new()\r
+\r
+    def new(self):\r
+        global _mapengine\r
+        _mapengine = MapEngine(20, 20, 1, -1, 0, +19)\r
+        _undomanager.clear()\r
+        _undomanager.save(_mapengine.savestring())\r
+        self.setTitle(None)\r
+        try:\r
+            self.mainframe.mapframe.repaint()\r
+        except:\r
+            pass\r
+\r
+    @QtCore.Slot()\r
+    def open_triggered(self):\r
+        fileName = QtGui.QFileDialog.getOpenFileName(\r
+            filter=u"*.pydun;;*.*", selectedFilter=u"*.pydun")\r
+        if fileName[0] != u"":\r
+            self.open(fileName[0])\r
+\r
+    def open(self, fileName):\r
+        _mapengine.load(fileName)\r
+        _undomanager.clear()\r
+        _undomanager.save(_mapengine.savestring())\r
+        self.setTitle(_mapengine.fileName)\r
+        self.mainframe.mapframe.repaint()\r
+\r
+    @QtCore.Slot()\r
+    def save_triggered(self):\r
+        if _mapengine.fileName:\r
+            self.save(_mapengine.fileName)\r
+        else:\r
+            self.saveas_triggered()\r
+\r
+    @QtCore.Slot()\r
+    def saveas_triggered(self):\r
+        fileName = QtGui.QFileDialog.getSaveFileName(\r
+            filter=u"*.pydun;;*.*", selectedFilter=u"*.pydun")\r
+        if fileName[0] != u"":\r
+            self.save(fileName[0])\r
+\r
+    def save(self, fileName):\r
+        _mapengine.save(fileName)\r
+        self.setTitle(_mapengine.fileName)\r
+\r
+    @QtCore.Slot()\r
+    def exit_triggered(self):\r
+        self.close()\r
+\r
+    def closeEvent(self, event):\r
+        if self.exit():\r
+            event.accept()\r
+        else:\r
+            event.ignore()\r
+\r
+    def exit(self):\r
+        if QtGui.QMessageBox.Ok == QtGui.QMessageBox.question(\r
+            self, u"確認", u"終了しますか?",\r
+            (QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)):\r
+            sys.exit()\r
+            return True\r
+        return False\r
+\r
+    @QtCore.Slot()\r
+    def undo_triggered(self):\r
+        global _mapengine\r
+        _mapengine.loadfromstring(_undomanager.undo())\r
+        self.mainframe.mapframe.repaint()\r
+\r
+    @QtCore.Slot()\r
+    def redo_triggered(self):\r
+        global _mapengine\r
+        _mapengine.loadfromstring(_undomanager.redo())\r
+        self.mainframe.mapframe.repaint()\r
+\r
+    @QtCore.Slot()\r
+    def setorigine_triggered(self):\r
+        title = u"座標設定"\r
+        if self.mainframe.mapframe.setoriginemode:\r
+            QtGui.QMessageBox.information(\r
+                self, title, u"座標設定を中止します。", QtGui.QMessageBox.Ok)\r
+            self.mainframe.mapframe.setoriginemode = False\r
+        else:\r
+            if QtGui.QMessageBox.Ok == QtGui.QMessageBox.information(\r
+                self, title, u"基準にする地点をクリックしてください。",\r
+                (QtGui.QMessageBox.Ok| QtGui.QMessageBox.Cancel)):\r
+                self.mainframe.mapframe.setoriginemode = True\r
+\r
+    @QtCore.Slot()\r
+    def setmapsize_triggered(self):\r
+        dlg = SetSizeDialog(self)\r
+        dlg.setoriginalsize(_mapengine.width, _mapengine.height)\r
+        dlg.exec_()\r
+        if dlg.result() == QtGui.QDialog.Accepted:\r
+            top, bottom, left, right = dlg.getsize()\r
+            _mapengine.changesize(top, bottom, left, right)\r
+            _undomanager.save(_mapengine.savestring())\r
+            self.mainframe.mapframe.repaint()\r
+\r
+    @QtCore.Slot()\r
+    def tutorial_triggered(self):\r
+        url = os.path.dirname(os.path.abspath(__file__)) + "/help/index.html"\r
+        webbrowser.open_new_tab(url)\r
+\r
+    @QtCore.Slot()\r
+    def project_triggered(self):\r
+        webbrowser.open_new_tab(projecturl)\r
+\r
+    @QtCore.Slot()\r
+    def about_triggered(self):\r
+        QtGui.QMessageBox.about(self, "Pydun",\r
+        u"<h1>Pydun.py "+ projectversion + "</h1>"\r
+        u"<p>Copyright (c) 2013 WATAHIKI Hiroyuki</p>"\r
+        u"<p>url: <a href='" + projecturl + "'>" + projecturl + "</a></p>"\r
+        u"<p>e-mail: hrwatahiki at gmail.com</p>"\r
+        u"<p>このソフトウェアはMITライセンスです。</p>"\r
+        u"<p>このソフトウェアは以下のソフトウェアを使用しています。: "\r
+        u"Python, PySide, PyYAML "\r
+        u"これらの作成者に深く感謝いたします。</p>"\r
+        u"<p>詳細はLICENCE.txtを参照してください。</p>")\r
+\r
+\r
+class MainFrame(QtGui.QFrame):\r
+    create_wall_menu_triggered_signal = QtCore.Signal(int, int, str, int)\r
+\r
+    def __init__(self, parent=None):\r
+        super(MainFrame, self).__init__(parent)\r
+\r
+        self.mapframe = MapFrame(self)\r
+        scrollarea = QtGui.QScrollArea(self)\r
+        scrollarea.setWidget(self.mapframe)\r
+\r
+        self.detail = QtGui.QLabel(self)\r
+        self.detail.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)\r
+        self.detail.setText(u"")\r
+        self.detail.setMaximumHeight(100)\r
+        self.detail.setMinimumHeight(100)\r
+\r
+        self.boxdrawbutton = QtGui.QRadioButton(self)\r
+        self.boxdrawbutton.setText(u"ボックス形式で壁を描画(&B)")\r
+        self.boxdrawbutton.setChecked(True)\r
+        self.boxdrawbutton.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+        self.growdrawbutton = QtGui.QRadioButton(self)\r
+        self.growdrawbutton.setText(u"足跡形式で壁を描画(&G)")\r
+        self.growdrawbutton.setChecked(False)\r
+        self.growdrawbutton.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+        self.backcolorbutton = QtGui.QRadioButton(self)\r
+        self.backcolorbutton.setText(u"背景色(&C)")\r
+        self.backcolorbutton.setChecked(False)\r
+        self.backcolorbutton.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+        self.setbackcolorbutton = QtGui.QPushButton(self)\r
+        self.setbackcolorbutton.setText(u"背景色を設定(&S)...")\r
+        self.setbackcolorbutton.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+        self.backcolorbox = ColorBox(self)\r
+        self.backcolorbox.setMinimumSize(30, 30)\r
+        self.backcolorbox.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+\r
+        layout = QtGui.QGridLayout(self)\r
+        layout.addWidget(scrollarea, 0, 0, 1, 3)\r
+        layout.addWidget(self.detail, 1, 0, 4, 1)\r
+        layout.addWidget(self.boxdrawbutton, 1, 1, 1, 2)\r
+        layout.addWidget(self.growdrawbutton, 2, 1, 1, 2)\r
+        layout.addWidget(self.backcolorbutton, 3, 1, 1, 2)\r
+        layout.addWidget(self.setbackcolorbutton, 4, 1, 1, 1)\r
+        layout.addWidget(self.backcolorbox, 4, 2, 1, 1)\r
+\r
+        self.setLayout(layout)\r
+\r
+        self.h_wall_menu = self.create_wall_menu("h")\r
+        self.v_wall_menu = self.create_wall_menu("v")\r
+\r
+        self.mapframe.mouse_moved.connect(self.mouse_moved)\r
+        self.mapframe.mouse_released.connect(self.mouse_released)\r
+        self.mapframe.mouse_drag_released.connect(self.mouse_drag_released)\r
+        self.create_wall_menu_triggered_signal.connect(\r
+            self.create_wall_menu_triggered)\r
+        self.setbackcolorbutton.clicked.connect(\r
+            self.setbackcolorbutton_clicked)\r
+\r
+    def create_wall_menu(self, direction):\r
+        menu = QtGui.QMenu(self)\r
+        for idx, img in enumerate(_mapimages.wall_icons):\r
+            act = QtGui.QAction(self)\r
+            act.setIcon(img[direction])\r
+\r
+            def triggerd(idx):\r
+                def emit():\r
+                    self.create_wall_menu_triggered_signal.emit(menu.x, menu.y, direction, idx)\r
+                return emit\r
+\r
+            act.triggered.connect(triggerd(idx))\r
+            menu.addAction(act)\r
+        return menu\r
+\r
+    @QtCore.Slot(int, int, int)\r
+    def mouse_moved(self, x=0, y=0, b=QtCore.Qt.MouseButton.NoButton):\r
+        cood = u"({x}, {y})\n".format(x=_mapengine.viewx(x), y=_mapengine.viewy(y))\r
+        self.detail.setText(cood + _mapengine.getdetail(x, y))\r
+        self.mapframe.repaint()\r
+\r
+    @QtCore.Slot(int, int, int, int, int)\r
+    def mouse_drag_released(self, x1, y1, x2, y2, eraseonly):\r
+        if self.boxdrawbutton.isChecked():\r
+            _mapengine.growwall(x1, y1, x2, y2, eraseonly, True)\r
+        elif self.growdrawbutton.isChecked():\r
+            _mapengine.growwall(x1, y1, x2, y2, eraseonly, False)\r
+        elif self.backcolorbutton.isChecked():\r
+            if eraseonly:\r
+                backcolor = ""\r
+            else:\r
+                backcolor = getcolorstring(self.backcolorbox.color)\r
+            _mapengine.fillbackcolor(x1, y1, x2, y2, backcolor)\r
+        _undomanager.save(_mapengine.savestring())\r
+        self.mapframe.repaint()\r
+\r
+    @QtCore.Slot(int, int, str)\r
+    def mouse_released(self, x1, y1, direction):\r
+        #座標設定モード\r
+        if self.mapframe.setoriginemode:\r
+            dlg = SetOrigineDialog(self)\r
+            dlg.setcurrent(_mapengine.viewx(x1), _mapengine.viewy(y1))\r
+            dlg.exec_() #showでは処理がとまらない。\r
+            if dlg.result() == QtGui.QDialog.Accepted:\r
+                _mapengine.setoffset(\r
+                    dlg.originex - _mapengine.viewx(x1) + _mapengine.offsetx,\r
+                    dlg.originey - _mapengine.viewy(y1) + _mapengine.offsety\r
+                )\r
+                _undomanager.save(_mapengine.savestring())\r
+            self.mapframe.setoriginemode = False\r
+            return\r
+\r
+        if direction == "c":\r
+            dlg = DetailDialog(self)\r
+            dlg.setvalue(_mapengine.viewx(x1), _mapengine.viewy(y1),\r
+                _mapengine.getmark(x1, y1), _mapengine.getdetail(x1, y1),\r
+                getcolorfromstring(_mapengine.getforecolor(x1, y1)))\r
+            dlg.exec_() #showでは処理がとまらない。\r
+            if dlg.result() == QtGui.QDialog.Accepted:\r
+                forecolor = getcolorstring(dlg.forecolorbox.color)\r
+                _mapengine.setmark(x1, y1, dlg.marktext.text())\r
+                _mapengine.setdetail(x1, y1, dlg.detailtext.toPlainText())\r
+                _mapengine.setforecolor(x1, y1, forecolor)\r
+                _undomanager.save(_mapengine.savestring())\r
+                self.mapframe.repaint()\r
+            else:\r
+                pass\r
+        else:\r
+            if direction == "h":\r
+                menu = self.h_wall_menu\r
+            elif direction == "v":\r
+                menu = self.v_wall_menu\r
+            menu.x = x1\r
+            menu.y = y1\r
+            menu.popup(QtGui.QCursor.pos())\r
+\r
+    @QtCore.Slot(int, int, str, int)\r
+    def create_wall_menu_triggered(self, x1, y1, direction, wall):\r
+        _mapengine.setdata(x1, y1, direction, wall)\r
+        _undomanager.save(_mapengine.savestring())\r
+        self.mapframe.repaint()\r
+\r
+    @QtCore.Slot()\r
+    def setbackcolorbutton_clicked(self):\r
+        dlg = QtGui.QColorDialog(self)\r
+        dlg.exec_()\r
+        if dlg.result() == QtGui.QDialog.Accepted:\r
+            self.backcolorbox.color = dlg.currentColor()\r
+            self.backcolorbutton.setChecked(True)\r
+\r
+\r
+class MapFrame(QtGui.QFrame):\r
+    mouse_moved = QtCore.Signal(int, int, int)\r
+    mouse_released = QtCore.Signal(int, int, str)\r
+    mouse_drag_released = QtCore.Signal(int, int, int, int, int)\r
+    global _mapengine\r
+    global _mapimages\r
+\r
+    def __init__(self, parent=None):\r
+        super(MapFrame, self).__init__(parent)\r
+        self._pressedbutton = QtCore.Qt.MouseButton.NoButton\r
+        self._x1 = 0\r
+        self._y1 = 0\r
+        self._x2 = 0\r
+        self._y2 = 0\r
+        self._px1 = 0\r
+        self._py1 = 0\r
+        self._px2 = 0\r
+        self._py2 = 0\r
+        self._dragging = False\r
+        self.setoriginemode = False\r
+        self.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+        self.resize(\r
+            _mapimages.width * (_mapengine.width) + _mapimages.widthoffset * 2,\r
+            _mapimages.height * (_mapengine.height) + _mapimages.heightoffset * 2\r
+        )\r
+\r
+    def paintEvent(self, event):\r
+        painter = QtGui.QPainter(self)\r
+        painter.fillRect(0, 0, self.width(), self.height(), QtGui.QColor(255, 255, 255))\r
+        w = _mapimages.width\r
+        v = _mapimages.height\r
+        ho = _mapimages.heightoffset\r
+        wo = _mapimages.widthoffset\r
+\r
+        #エリアサイズを再計算\r
+        self.resize(\r
+            _mapimages.width * (_mapengine.width) + _mapimages.widthoffset * 2,\r
+            _mapimages.height * (_mapengine.height) + _mapimages.heightoffset * 2\r
+        )\r
+\r
+        #backcolor\r
+        for x in range(_mapengine.width):\r
+            xx = x * w\r
+            for y in range(_mapengine.height):\r
+                yy = y * v\r
+                backcolor = _mapengine.getbackcolor(x, y)\r
+                if backcolor:\r
+                    painter.fillRect(wo + xx, ho + yy, w, v,\r
+                        getcolorfromstring(backcolor))\r
+\r
+        #wall\r
+        for x in range(_mapengine.width + 1):\r
+            xx = x * w\r
+            for y in range(_mapengine.height + 1):\r
+                yy = y * v\r
+                if x != _mapengine.width:\r
+                    painter.drawImage(wo + xx, yy,\r
+                        _mapimages.wall(_mapengine.getdata(x, y, "h"), "h"))\r
+                if y != _mapengine.height:\r
+                    painter.drawImage(xx, ho + yy,\r
+                        _mapimages.wall(_mapengine.getdata(x, y, "v"), "v"))\r
+                mark = _mapengine.getmark(x, y)\r
+                if mark != "":\r
+                    painter.setPen(getcolorfromstring(_mapengine.getforecolor(x, y)))\r
+                    painter.drawText(wo + xx + 1, ho + yy + 1, w - 2, v - 2,\r
+                        QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter,\r
+                        mark)\r
+\r
+        #座標設定中はdrawing box を表示しない。\r
+        if self.setoriginemode:\r
+            return\r
+\r
+        #drawing box\r
+        if self._pressedbutton != QtCore.Qt.MouseButton.NoButton:\r
+            if self._pressedbutton == QtCore.Qt.MouseButton.LeftButton:\r
+                if self._x1 == self._x2 and self._y1 == self._y2:\r
+                    painter.setPen(QtGui.QColor(255, 0, 0))\r
+                elif self._x1 == self._x2 or self._y1 == self._y2:\r
+                    painter.setPen(QtGui.QColor(0, 255, 0))\r
+                else:\r
+                    painter.setPen(QtGui.QColor(255, 0, 0))\r
+            elif self._pressedbutton == QtCore.Qt.MouseButton.RightButton:\r
+                painter.setPen(QtGui.QColor(0, 0, 255))\r
+            painter.drawRect(self._px1, self._py1,\r
+                self._px2 - self._px1, self._py2 - self._py1)\r
+\r
+    def eventFilter(self, obj, event):\r
+        def xpos():\r
+            return ((event.pos().x() - _mapimages.widthoffset) // _mapimages.width)\r
+\r
+        def ypos():\r
+            return ((event.pos().y() - _mapimages.heightoffset) // _mapimages.height)\r
+\r
+        if obj == self:\r
+            et = event.type()\r
+\r
+            if et == QtCore.QEvent.MouseButtonPress:\r
+                self._x1 = xpos()\r
+                self._y1 = ypos()\r
+                self._pos1 = event.pos()\r
+                self._px1 = event.pos().x()\r
+                self._py1 = event.pos().y()\r
+                self._x2 = xpos()\r
+                self._y2 = ypos()\r
+                self._px2 = event.pos().x()\r
+                self._py2 = event.pos().y()\r
+                self._pressedbutton = event.buttons()\r
+                self._dragging = False\r
+                return True\r
+\r
+            elif et == QtCore.QEvent.MouseMove:\r
+                self._x2 = xpos()\r
+                self._y2 = ypos()\r
+                self._px2 = event.pos().x()\r
+                self._py2 = event.pos().y()\r
+                if (self._pressedbutton != QtCore.Qt.MouseButton.NoButton and\r
+                    (event.pos() - self._pos1).manhattanLength() >=\r
+                     QtGui.QApplication.startDragDistance()):\r
+                    self._dragging = True\r
+                self.mouse_moved.emit(self._x2, self._y2, event.buttons())\r
+                return True\r
+\r
+            elif et == QtCore.QEvent.MouseButtonRelease:\r
+                drag_emit = False\r
+                release_emit = False\r
+                if self._dragging:\r
+                    drag_emit = True\r
+                    if self._pressedbutton == QtCore.Qt.MouseButton.LeftButton:\r
+                        eraseonly = False\r
+                    elif self._pressedbutton == QtCore.Qt.MouseButton.RightButton:\r
+                        eraseonly = True\r
+                else:\r
+                    release_emit = True\r
+                if self.setoriginemode:\r
+                    release_emit = True\r
+\r
+                self._pressedbutton = QtCore.Qt.MouseButton.NoButton\r
+                self._dragging = False\r
+                if drag_emit:\r
+                    self.mouse_drag_released.emit(\r
+                        self._x1, self._y1, self._x2, self._y2, eraseonly)\r
+                if release_emit:\r
+                    rpx = self._px2 - self._x2 * _mapimages.width - _mapimages.widthoffset\r
+                    rpy = self._py2 - self._y2 * _mapimages.height - _mapimages.heightoffset\r
+                    if rpx <= _mapimages.widthoffset:\r
+                        rx = self._x2\r
+                        ry = self._y2\r
+                        d = "v"\r
+                    elif rpx >= _mapimages.width - _mapimages.widthoffset:\r
+                        rx = self._x2 + 1\r
+                        ry = self._y2\r
+                        d = "v"\r
+                    elif rpy <= _mapimages.heightoffset:\r
+                        rx = self._x2\r
+                        ry = self._y2\r
+                        d = "h"\r
+                    elif rpy >= _mapimages.height - _mapimages.heightoffset:\r
+                        rx = self._x2\r
+                        ry = self._y2 + 1\r
+                        d = "h"\r
+                    else:\r
+                        rx = self._x2\r
+                        ry = self._y2\r
+                        d = "c"\r
+                    self.mouse_released.emit(rx, ry, d)\r
+                return True\r
+\r
+            else:\r
+                return False\r
+        else:\r
+            # pass the event on to the parent class\r
+            return False\r
+\r
+\r
+class ColorBox(QtGui.QFrame):\r
+    def __init__(self, parent=None):\r
+        super(ColorBox, self).__init__(parent)\r
+        self.color = QtGui.QColor(255, 255, 255)\r
+        self.bordercolor = QtGui.QColor(0, 0, 0)\r
+\r
+    def paintEvent(self, event):\r
+        painter = QtGui.QPainter(self)\r
+        painter.fillRect(0, 0, self.width(), self.height(), self.color)\r
+        painter.setPen(self.bordercolor)\r
+        painter.drawRect(0, 0, self.width() - 1, self.height() - 1)\r
+\r
+\r
+class DetailDialog(QtGui.QDialog):\r
+    def __init__(self, parent=None):\r
+        super(DetailDialog, self).__init__(parent)\r
+\r
+        marklabel = QtGui.QLabel(self)\r
+        marklabel.setAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)\r
+        marklabel.setText(u"マーク(&M)")\r
+        marklabel.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+        self.marktext = QtGui.QLineEdit(self)\r
+        self.marktext.setMaxLength(1)\r
+        self.marktext.setText(u"")\r
+        self.marktext.setMinimumWidth(20)\r
+        self.marktext.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+        marklabel.setBuddy(self.marktext)\r
+\r
+        self.forecolorbutton = QtGui.QPushButton(self)\r
+        self.forecolorbutton.setText(u"文字色(&C)...")\r
+        self.forecolorbutton.clicked.connect(self.forecolorbutton_clicked)\r
+\r
+        self.forecolorbox = ColorBox(self)\r
+        self.forecolorbox.setMinimumSize(30, 30)\r
+        self.forecolorbox.setSizePolicy(\r
+            QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)\r
+\r
+        detaillabel = QtGui.QLabel(self)\r
+        detaillabel.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)\r
+        detaillabel.setText(u"詳細(&D)")\r
+\r
+        self.detailtext = QtGui.QTextEdit(self)\r
+        self.detailtext.setText(u"")\r
+        detaillabel.setBuddy(self.detailtext)\r
+\r
+        self.buttonBox = QtGui.QDialogButtonBox(\r
+            QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)\r
+        self.buttonBox.accepted.connect(self.accept)\r
+        self.buttonBox.rejected.connect(self.reject)\r
+\r
+        layout = QtGui.QGridLayout()\r
+        layout.addWidget(marklabel, 0, 0, 1, 1)\r
+        layout.addWidget(self.marktext, 0, 1, 1, 1)\r
+        layout.addWidget(self.forecolorbutton, 0, 2, 1, 1)\r
+        layout.addWidget(self.forecolorbox, 0, 3, 1, 1)\r
+        layout.addWidget(detaillabel, 1, 0, 1, 1)\r
+        layout.addWidget(self.detailtext, 1, 1, 1, 3)\r
+        layout.addWidget(self.buttonBox, 2, 0, 1, 4)\r
+        self.setLayout(layout)\r
+        self.setModal(True)\r
+\r
+    def setvalue(self, x, y, mark, detail, color):\r
+        self.setWindowTitle("({x},{y})".format(x=x, y=y))\r
+        self.marktext.setText(mark)\r
+        self.detailtext.setText(detail)\r
+        self.forecolorbox.color = color\r
+\r
+    def forecolorbutton_clicked(self):\r
+        dlg = QtGui.QColorDialog(self)\r
+        dlg.exec_()\r
+        if dlg.result() == QtGui.QDialog.Accepted:\r
+            self.forecolorbox.color = dlg.currentColor()\r
+\r
+class SetOrigineDialog(QtGui.QDialog):\r
+    def __init__(self, parent=None):\r
+        super(SetOrigineDialog, self).__init__(parent)\r
+        self.setWindowTitle(u"座標設定")\r
+\r
+        promptlabel = QtGui.QLabel(self)\r
+        promptlabel.setAlignment(\r
+            QtCore.Qt.AlignVCenter | QtCore.Qt.AlignLeft)\r
+        promptlabel.setText(u"この地点の座標を入力してください。")\r
+\r
+        self.currentlabel = QtGui.QLabel(self)\r
+        self.currentlabel.setAlignment(\r
+            QtCore.Qt.AlignVCenter | QtCore.Qt.AlignHCenter)\r
+        self.currentlabel.setText(u"")\r
+\r
+        xlabel = QtGui.QLabel(self)\r
+        xlabel.setAlignment(\r
+            QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)\r
+        xlabel.setText(u"&X")\r
+\r
+        self.xbox = QtGui.QSpinBox(self)\r
+        self.xbox.setRange(-999, +999)\r
+        self.xbox.setSingleStep(1)\r
+        self.xbox.setValue(0)\r
+        xlabel.setBuddy(self.xbox)\r
+\r
+        ylabel = QtGui.QLabel(self)\r
+        ylabel.setAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)\r
+        ylabel.setText(u"&Y")\r
+\r
+        self.ybox = QtGui.QSpinBox(self)\r
+        self.ybox.setRange(-999, +999)\r
+        self.ybox.setSingleStep(1)\r
+        self.ybox.setValue(0)\r
+        ylabel.setBuddy(self.ybox)\r
+\r
+        self.buttonBox = QtGui.QDialogButtonBox(\r
+            QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)\r
+        self.buttonBox.accepted.connect(self.accept)\r
+        self.buttonBox.rejected.connect(self.reject)\r
+\r
+        layout = QtGui.QGridLayout()\r
+        layout.addWidget(promptlabel, 0, 0, 1, 4)\r
+        layout.addWidget(self.currentlabel, 1, 0, 1, 4)\r
+        layout.addWidget(xlabel, 2, 0, 1, 1)\r
+        layout.addWidget(self.xbox, 2, 1, 1, 1)\r
+        layout.addWidget(ylabel, 2, 2, 1, 1)\r
+        layout.addWidget(self.ybox, 2, 3, 1, 1)\r
+        layout.addWidget(self.buttonBox, 3, 0, 1, 4)\r
+        self.setLayout(layout)\r
+        self.setModal(True)\r
+\r
+    def setcurrent(self, x, y):\r
+        self.xbox.setValue(x)\r
+        self.ybox.setValue(y)\r
+        self.currentlabel.setText(u"現在の座標 ({x}, {y})".format(x=x, y=y))\r
+\r
+    @property\r
+    def originex(self):\r
+        return self.xbox.value()\r
+\r
+    @property\r
+    def originey(self):\r
+        return self.ybox.value()\r
+\r
+\r
+class SetSizeDialog(QtGui.QDialog):\r
+    def __init__(self, parent=None):\r
+        super(SetSizeDialog, self).__init__(parent)\r
+        self.setWindowTitle(u"マップのサイズ")\r
+\r
+        self.topbutton = QtGui.QRadioButton(self)\r
+        self.topbutton.setText(u"上(&T)")\r
+        self.topbutton.clicked.connect(self.updatewidgets)\r
+\r
+        self.topsize = QtGui.QSpinBox(self)\r
+        self.topsize.setSingleStep(1)\r
+        self.topsize.setValue(0)\r
+        self.topsize.valueChanged.connect(self.updatewidgets)\r
+\r
+        self.bottombutton = QtGui.QRadioButton(self)\r
+        self.bottombutton.setText(u"下(&B)")\r
+        self.bottombutton.clicked.connect(self.updatewidgets)\r
+\r
+        self.bottomsize = QtGui.QSpinBox(self)\r
+        self.bottomsize.setSingleStep(1)\r
+        self.bottomsize.setValue(0)\r
+        self.bottomsize.valueChanged.connect(self.updatewidgets)\r
+\r
+        self.leftbutton = QtGui.QRadioButton(self)\r
+        self.leftbutton.setText(u"左(&L)")\r
+        self.leftbutton.clicked.connect(self.updatewidgets)\r
+\r
+        self.leftsize = QtGui.QSpinBox(self)\r
+        self.leftsize.setSingleStep(1)\r
+        self.leftsize.setValue(0)\r
+        self.leftsize.valueChanged.connect(self.updatewidgets)\r
+\r
+        self.rightbutton = QtGui.QRadioButton(self)\r
+        self.rightbutton.setText(u"右(&R)")\r
+        self.rightbutton.clicked.connect(self.updatewidgets)\r
+\r
+        self.rightsize = QtGui.QSpinBox(self)\r
+        self.rightsize.setSingleStep(1)\r
+        self.rightsize.setValue(0)\r
+        self.rightsize.valueChanged.connect(self.updatewidgets)\r
+\r
+        self.sizelabel = QtGui.QLabel(self)\r
+        self.sizelabel .setAlignment(\r
+            QtCore.Qt.AlignVCenter | QtCore.Qt.AlignLeft)\r
+        self.sizelabel.setText(u"この地点の座標を入力してください。")\r
+\r
+        self.buttonbox = QtGui.QDialogButtonBox(\r
+        QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)\r
+        self.buttonbox.accepted.connect(self.accept)\r
+        self.buttonbox.rejected.connect(self.reject)\r
+\r
+        verticalgroup = QtGui.QButtonGroup(self)\r
+        verticalgroup.addButton(self.topbutton)\r
+        verticalgroup.addButton(self.bottombutton)\r
+\r
+        holizontalgroup = QtGui.QButtonGroup(self)\r
+        holizontalgroup.addButton(self.leftbutton)\r
+        holizontalgroup.addButton(self.rightbutton)\r
+\r
+        self.topbutton.setChecked(True)\r
+        self.bottombutton.setChecked(False)\r
+        self.leftbutton.setChecked(True)\r
+        self.rightbutton.setChecked(False)\r
+\r
+        layout = QtGui.QGridLayout(self)\r
+        layout.addWidget(self.topbutton, 0, 2, 1, 1)\r
+        layout.addWidget(self.topsize, 0, 3, 1, 1)\r
+        layout.addWidget(self.leftbutton, 1, 0, 1, 1)\r
+        layout.addWidget(self.leftsize, 1, 1, 1, 1)\r
+        layout.addWidget(self.sizelabel, 1, 2, 1, 2)\r
+        layout.addWidget(self.rightbutton, 1, 4, 1, 1)\r
+        layout.addWidget(self.rightsize, 1, 5, 1, 1)\r
+        layout.addWidget(self.bottombutton, 2, 2, 1, 1)\r
+        layout.addWidget(self.bottomsize, 2, 3, 1, 1)\r
+        layout.addWidget(self.buttonbox, 3, 0, 1, 6)\r
+        self.setLayout(layout)\r
+        self.setModal(True)\r
+\r
+    def setoriginalsize(self, width, height):\r
+        self._width = width\r
+        self._height = height\r
+        self.topsize.setRange(-height+1, +100)\r
+        self.bottomsize.setRange(-height+1, +100)\r
+        self.leftsize.setRange(-width+1, +100)\r
+        self.rightsize.setRange(-width+1, +100)\r
+        self.updatewidgets()\r
+\r
+    def updatewidgets(self):\r
+        dh = 0\r
+        dw = 0\r
+\r
+        if self.topbutton.isChecked():\r
+            dh = self.topsize.value()\r
+            self.topsize.setEnabled(True)\r
+            self.bottomsize.setDisabled(True)\r
+        elif self.bottombutton.isChecked():\r
+            dh = self.bottomsize.value()\r
+            self.topsize.setDisabled(True)\r
+            self.bottomsize.setEnabled(True)\r
+        if self.leftbutton.isChecked():\r
+            dw = self.leftsize.value()\r
+            self.leftsize.setEnabled(True)\r
+            self.rightsize.setDisabled(True)\r
+        elif self.rightbutton.isChecked():\r
+            dw = self.rightsize.value()\r
+            self.leftsize.setDisabled(True)\r
+            self.rightsize.setEnabled(True)\r
+\r
+        self.sizelabel.setText(\r
+            u"変更前のサイズ: {w1} x {h1}\n変更後のサイズ: {w2} x {h2}".format(\r
+                w1=self._width, h1=self._height,\r
+                w2=self._width+dw, h2=self._height+dh))\r
+\r
+    def getsize(self):\r
+        top = 0\r
+        bottom = 0\r
+        left = 0\r
+        right = 0\r
+        if self.topbutton.isChecked():\r
+            top = self.topsize.value()\r
+        elif self.bottombutton.isChecked():\r
+            bottom = self.bottomsize.value()\r
+        if self.leftbutton.isChecked():\r
+            left = self.leftsize.value()\r
+        elif self.rightbutton.isChecked():\r
+            right = self.rightsize.value()\r
+        return (top, bottom, left, right)\r
+\r
+class MapImages(object):\r
+    def __init__(self):\r
+        self.wall_images = list()\r
+        self.wall_icons = list()\r
+        for index in range(10):\r
+            self.wall_images.append(dict())\r
+            self.wall_icons.append(dict())\r
+            for direction in ["v", "h"]:\r
+                fileName = os.path.join(\r
+                    os.path.dirname(os.path.abspath(__file__)),\r
+                    u"images",\r
+                    u"wall_{direction}_{index:02}.png".format(\r
+                        direction=direction, index=index))\r
+                self.wall_images[index][direction] = QtGui.QImage()\r
+                self.wall_images[index][direction].load(fileName)\r
+                self.wall_icons[index][direction] = QtGui.QIcon(fileName)\r
+\r
+\r
+    @property\r
+    def width(self):\r
+        return self.wall_images[0]["h"].width()\r
+\r
+    @property\r
+    def height(self):\r
+        return self.wall_images[0]["v"].height()\r
+\r
+    @property\r
+    def widthoffset(self):\r
+        return self.wall_images[0]["v"].width()//2\r
+\r
+    @property\r
+    def heightoffset(self):\r
+        return self.wall_images[0]["h"].height()//2\r
+\r
+    def wall(self, index, direction):\r
+        return self.wall_images[index][direction]\r
+\r
+\r
+class MapEngine(object):\r
+    hwall = " -#WMwmHVA"\r
+    vwall = " |#PCpc=DG"\r
+\r
+    def __init__(self, width, height, signx, signy, offsetx, offsety):\r
+        self._width = width\r
+        self._height = height\r
+        self._signx = signx\r
+        self._signy = signy\r
+        self._offsetx = offsetx\r
+        self._offsety = offsety\r
+        self.fileName = None\r
+\r
+        self.initdata()\r
+        self.inityaml()\r
+        self._note = dict()\r
+\r
+    def initdata(self):\r
+        width = self.width + 1\r
+        height = self.height + 1\r
+        self._data = self.initialdata(width, height)\r
+\r
+    def initialdata(self, width, height):\r
+        dt = list()\r
+        for x in range(width):\r
+            dt.append(list())\r
+            for y in range(height):\r
+                dt[x].append(dict())\r
+                for d in ["h", "v"]:\r
+                    dt[x][y][d] = 0\r
+        return dt\r
+\r
+    def inityaml(self):\r
+        #yaml !python/Unicode出力抑止おまじない\r
+        def represent_unicode(dumper, data):\r
+            return dumper.represent_scalar("tag:yaml.org,2002:str", data)\r
+        def construct_unicode(loader, node):\r
+            return unicode(loader.construct_scalar(node))\r
+        yaml.add_representer(unicode, represent_unicode)\r
+        yaml.add_constructor("tag:yaml.org,2002:str", construct_unicode)\r
+\r
+    def getdata(self, x, y, direction):\r
+        return self._data[x][y][direction]\r
+\r
+    def setdata(self, x, y, direction, value):\r
+        self._data[x][y][direction] = value\r
+\r
+    @property\r
+    def width(self):\r
+        return self._width\r
+\r
+    @property\r
+    def height(self):\r
+        return self._height\r
+\r
+    @property\r
+    def signx(self):\r
+        return self._signx\r
+\r
+    @property\r
+    def signy(self):\r
+        return self._signy\r
+\r
+    @property\r
+    def offsetx(self):\r
+        return self._offsetx\r
+\r
+    @property\r
+    def offsety(self):\r
+        return self._offsety\r
+\r
+    def setoffset(self, x, y):\r
+        self._offsetx = x\r
+        self._offsety = y\r
+\r
+    def getmark(self, x, y):\r
+        return self.unescape(self.getnote(x, y)["mark"])\r
+\r
+    def getdetail(self, x, y):\r
+        return self.unescape(self.getnote(x, y)["detail"])\r
+\r
+    def getforecolor(self, x, y):\r
+        return self.getnote(x, y)["forecolor"]\r
+\r
+    def getbackcolor(self, x, y):\r
+        return self.getnote(x, y)["backcolor"]\r
+\r
+    def getnote(self, x, y):\r
+        return self._note.get(\r
+            self.coodtokey(x, y), {"mark":u"", "detail":u"", "forecolor":u"#000000", "backcolor":u""})\r
+\r
+    def coodtokey(self, x, y):\r
+        return u"{x:+05d}_{y:+05d}".format(x=x, y=y)\r
+\r
+    def keytocood(self, key):\r
+        return map(int, key.split("_"))\r
+\r
+    def setmark(self, x, y, mark):\r
+        note = self.getnote(x, y)\r
+        note["mark"] = self.escape(mark)\r
+        self.setnote(x, y, note)\r
+\r
+    def setdetail(self, x, y, detail):\r
+        note = self.getnote(x, y)\r
+        note["detail"] = self.escape(detail)\r
+        self.setnote(x, y, note)\r
+\r
+    def setforecolor(self, x, y, color):\r
+        note = self.getnote(x, y)\r
+        note["forecolor"] = color\r
+        self.setnote(x, y, note)\r
+\r
+    def setbackcolor(self, x, y, color):\r
+        note = self.getnote(x, y)\r
+        note["backcolor"] = color\r
+        self.setnote(x, y, note)\r
+\r
+    def setnote(self, x, y, note):\r
+        self._note[self.coodtokey(x, y)] = note\r
+\r
+    def escape(self, s):\r
+        return s.replace("\\", "\\\\").replace("\n", r"\n")\r
+\r
+    def unescape(self, s):\r
+        return s.replace(r"\n", "\n").replace("\\\\", "\\")\r
+\r
+    def viewx(self, x):\r
+        return x * self.signx + self.offsetx\r
+\r
+    def viewy(self, y):\r
+        return y * self.signy + self.offsety\r
+\r
+    def worldx(self, x):\r
+        return (x - self.offsetx) / self.signx\r
+\r
+    def worldy(self, y):\r
+        return (y - self.offsety) / self.signy\r
+\r
+    def changesize(self, top, bottom, left, right):\r
+        oldoffsetx = max(-left, 0)\r
+        newoffsetx = max(left, 0)\r
+        newwidth = self.width + left + right\r
+        oldoffsety = max(-top, 0)\r
+        newoffsety = max(top, 0)\r
+        newheight = self.height + top + bottom\r
+\r
+        newdata = self.initialdata(newwidth + 1, newheight + 1)\r
+        newnote = dict()\r
+        for x in range(min(self._width, newwidth) + 1):\r
+            for y in range(min(self._height, newheight) + 1):\r
+                for d in ["h", "v"]:\r
+                    newdata[x+newoffsetx][y+newoffsety][d] = self._data[x+oldoffsetx][y+oldoffsety][d]\r
+                newnote[self.coodtokey(x+newoffsetx, y+newoffsety)] = self.getnote(x+oldoffsetx, y+oldoffsety)\r
+        self._width = newwidth\r
+        self._height = newheight\r
+        self.setoffset(self.offsetx -self.signx * left, self.offsety -self.signy * top)\r
+        self._data = newdata\r
+        self._note = newnote\r
+\r
+    def growwall(self, x1, y1, x2, y2, eraseonly, alwaysbox):\r
+        stepx, stepy = self.getstep(x1, y1, x2, y2)\r
+        offsetx, offsety = self.getoffset(x1, y1, x2, y2)\r
+\r
+        #delete inner walls.\r
+        for x in range(x1, x2+stepx, stepx):\r
+            for y in range(y1+stepy+offsety, y2+stepy+offsety, stepy):\r
+                self._data[x][y]["h"] = 0\r
+        for x in range(x1+stepx+offsetx, x2+stepx+offsetx, stepx):\r
+            for y in range(y1, y2+stepy, stepy):\r
+                self._data[x][y]["v"] = 0\r
+\r
+        if not eraseonly:\r
+            #draw OUTER wall if it exists.\r
+            if alwaysbox or (x1 == x2 and y1 == y2):\r
+                hline = False\r
+                vline = False\r
+            elif x1 == x2:\r
+                hline = True\r
+                vline = False\r
+            elif y1 == y2:\r
+                hline = False\r
+                vline = True\r
+            else:\r
+                hline = False\r
+                vline = False\r
+\r
+            for x in range(x1, x2+stepx, stepx):\r
+                if not (vline and x == x1):\r
+                    if not hline:\r
+                        if self._data[x][y1+offsety]["h"] == 0:\r
+                            self._data[x][y1+offsety]["h"] = 1\r
+                    if self._data[x][y2+stepy+offsety]["h"] == 0:\r
+                        self._data[x][y2+stepy+offsety]["h"] = 1\r
+            for y in range(y1, y2+stepy, stepy):\r
+                if not (hline and y == y1):\r
+                    if not vline:\r
+                        if self._data[x1+offsetx][y]["v"] == 0:\r
+                            self._data[x1+offsetx][y]["v"] = 1\r
+                    if self._data[x2+stepx+offsetx][y]["v"] == 0:\r
+                        self._data[x2+stepx+offsetx][y]["v"] = 1\r
+\r
+    def fillbackcolor(self, x1, y1, x2, y2, backcolor):\r
+        stepx, stepy = self.getstep(x1, y1, x2, y2)\r
+        for x in range(x1, x2+stepx, stepx):\r
+            for y in range(y1, y2+stepy, stepy):\r
+                self.setbackcolor(x, y, backcolor)\r
+\r
+    def getstep(self, x1, y1, x2, y2):\r
+        if x1 <= x2:\r
+            stepx = 1\r
+        else:\r
+            stepx = -1\r
+        if y1 <= y2:\r
+            stepy = 1\r
+        else:\r
+            stepy = -1\r
+        return (stepx, stepy)\r
+\r
+    def getoffset(self, x1, y1, x2, y2):\r
+        if x1 <= x2:\r
+            offsetx = 0\r
+        else:\r
+            offsetx = 1\r
+        if y1 <= y2:\r
+            offsety = 0\r
+        else:\r
+            offsety = 1\r
+        return (offsetx, offsety)\r
+\r
+    def save(self, fileName):\r
+        dt = self.savestring()\r
+        with codecs.open(fileName, "w", encoding="utf-8") as f:\r
+            f.write(dt)\r
+\r
+    def savestring(self):\r
+        data = dict()\r
+        data["size"] = {"x":self.width, "y":self.height}\r
+        data["offset"] = {"x":self.offsetx, "y":self.offsety}\r
+        data["sign"] = {"x":self.signx, "y":self.signy}\r
+        data["map"] = self.getmapstring()\r
+\r
+        #noteは表示用に座標変換する。\r
+        n = dict()\r
+        for nk, ni in self._note.items():\r
+            if ni["mark"] != "" or ni["detail"] != "" or ni["backcolor"]:\r
+                x, y = self.keytocood(nk)\r
+                n[self.coodtokey(self.viewx(x), self.viewy(y))] = ni\r
+        data["note"] = n\r
+        return yaml.safe_dump(data, allow_unicode=True,\r
+                default_flow_style=False, encoding='utf-8')\r
+\r
+    def getmapstring(self):\r
+        #出力用マップ作成\r
+        m = []\r
+        for y in range(self.height):\r
+            s = [" "]\r
+            for x in range(self.width):\r
+                s.append("+")\r
+                s.append(self.hwall[self._data[x][y]["h"]])\r
+            s.append("+")\r
+            s.append(" ")\r
+            m.append("".join(s))\r
+            s = [" "]\r
+            for x in range(self.width):\r
+                s.append(self.vwall[self._data[x][y]["v"]])\r
+                s.append(" ")\r
+            s.append(self.vwall[self._data[self.width][y]["v"]])\r
+            s.append(" ")\r
+            m.append("".join(s))\r
+        y = self.height\r
+        s = [" "]\r
+        for x in range(self.width):\r
+            s.append("+")\r
+            s.append(self.hwall[self._data[x][y]["h"]])\r
+        s.append("+")\r
+        s.append(" ")\r
+        m.append("".join(s))\r
+        return m\r
+\r
+    def load(self, fileName):\r
+        with codecs.open(fileName, "r", encoding="utf-8") as f:\r
+            st = f.read()\r
+        self.loadfromstring(st)\r
+        self.fileName = fileName\r
+\r
+    def loadfromstring(self, st):\r
+        data = yaml.safe_load(st)\r
+\r
+        #基本情報\r
+        self._width = data["size"]["x"]\r
+        self._height = data["size"]["y"]\r
+        self._signx = data["sign"]["x"]\r
+        self._signy = data["sign"]["y"]\r
+        self._offsetx = data["offset"]["x"]\r
+        self._offsety = data["offset"]["y"]\r
+\r
+        #マップ\r
+        self.initdata()\r
+        for y in range(self.height):\r
+            for x in range(self.width):\r
+                self._data[x][y]["h"] = self.hwall.find(data["map"][y*2][1+x*2+1])\r
+                self._data[x][y]["v"] = self.vwall.find(data["map"][y*2+1][1+x*2])\r
+        x = self.width\r
+        for y in range(self.height):\r
+            self._data[x][y]["v"] = self.vwall.find(data["map"][y*2+1][1+x*2])\r
+        y = self.height\r
+        for x in range(self.width):\r
+            self._data[x][y]["h"] = self.hwall.find(data["map"][y*2][1+x*2+1])\r
+\r
+        #noteは内部用に座標変換する。\r
+        n = dict()\r
+        for nk, ni in data["note"].items():\r
+            if ni["mark"] != "" or ni["detail"] != "" or ni["backcolor"] != "":\r
+                x, y = self.keytocood(nk)\r
+                n[self.coodtokey(self.worldx(x), self.worldy(y))] = ni\r
+\r
+        self._note = n\r
+\r
+\r
+class UndoManager(QtCore.QObject):\r
+    MAX_UNDO_COUNT = 128\r
+    changed = QtCore.Signal(bool, bool)\r
+\r
+    def __init__(self):\r
+        super(UndoManager, self).__init__()\r
+        self.clear()\r
+\r
+    def clear(self):\r
+        self._undo = [None for x in range(self.MAX_UNDO_COUNT)]\r
+        self._index = 0\r
+        self._undocount = 0\r
+        self.changed.emit(self.canundo, self.canredo)\r
+\r
+    def save(self, obj):\r
+        if self._index >= self.MAX_UNDO_COUNT:\r
+            self._undo = self._undo[1:]\r
+            self._index -= 1\r
+            self._undo.append(None)\r
+        self._undo[self._index] = obj\r
+        self._index += 1\r
+        self._undocount = 0\r
+        self.changed.emit(self.canundo, self.canredo)\r
+\r
+    def undo(self):\r
+        self._index -= 1\r
+        self._undocount += 1\r
+        self.changed.emit(self.canundo, self.canredo)\r
+        return self._undo[self._index - 1]\r
+\r
+    def redo(self):\r
+        self._index += 1\r
+        self._undocount -= 1\r
+        self.changed.emit(self.canundo, self.canredo)\r
+        return self._undo[self._index - 1]\r
+\r
+    @property\r
+    def canundo(self):\r
+        return (self._index > 1)\r
+\r
+    @property\r
+    def canredo(self):\r
+        return (self._undocount > 0)\r
+\r
+\r
+def getcolorstring(color):\r
+    return "#{r:02x}{g:02x}{b:02x}".format(r=color.red(), g=color.green(), b=color.blue())\r
+\r
+def getcolorfromstring(colorstring):\r
+    return QtGui.QColor.fromRgb(\r
+        int(colorstring[1:3], 16),\r
+        int(colorstring[3:5], 16),\r
+        int(colorstring[5:7], 16))\r
+\r
+\r
+def main():\r
+    app = QtGui.QApplication(sys.argv)\r
+    mainWin = MainWindow()\r
+    app.installEventFilter(mainWin.centralWidget().mapframe)\r
+    mainWin.show()\r
+    sys.exit(app.exec_())\r
+\r
+\r
+if __name__ == '__main__':\r
+    main()\r
diff --git a/help/index.html b/help/index.html
new file mode 100644 (file)
index 0000000..35dc567
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html>\r
+<html lang='ja'>\r
+<head>\r
+    <meta charset="utf-8">\r
+    <title>Pydunヘルプ</title>\r
+    <style type="text/css">\r
+        h2 {\r
+            border-left-style: solid;\r
+            border-left-width: thick;\r
+            border-left-color: green;\r
+            padding-left: 0.25em;\r
+            border-bottom-style: solid;\r
+            border-bottom-width: medium;\r
+            border-bottom-color: green;\r
+        }\r
+        .dialog {\r
+            vertical-align: top;\r
+        }\r
+    </style>\r
+</head>\r
+<body>\r
+    <div>\r
+        <h1>Pydunヘルプ</h1>\r
+            <p>Pydunは3DダンジョンRPG用のマッピングツールです。</p>\r
+            <h2>連絡先</h2>\r
+                <p>不具合、ご要望などございましたら、以下までご連絡ください。</p>\r
+                <p>url: <a href='http://sourceforge.jp/projects/pydun/'>http://sourceforge.jp/projects/pydun/</a><br>\r
+                email: hrwatahiki at gmail.com</p>\r
+            <h2>インストール</h2>\r
+                <p>インストール作業は不要です。pydun.exeをダブルクリックすればプログラムが起動できます。アンインストール時はフォルダーごと削除してください。(レジストリーは使用していません)</p>\r
+            <h2>使い方</h2>\r
+            <p>ドラッグすると壁を描画できます。<br>\r
+            <table><tr><td><img src="./images/box_before.png"></td> <td>→</td> <td><img src="./images/box_after.png"></td></tr></table></p>\r
+            <p>右クリックからのドラッグで壁を削除できます。</p>\r
+            <table><tr><td><img src="./images/delete_before.png"></td> <td>→</td> <td><img src="./images/delete_after.png"></td></tr></table></p>\r
+            <p>背景色も同様です。<br>\r
+            <table><tr><td><img src="./images/backcolor_before.png"></td> <td>→</td> <td><img src="./images/backcolor_after.png"></td></tr></table></p>\r
+            <p>壁をクリックすると直接修正できます。<br>\r
+            <table><tr><td><img src="./images/wall_before.png"></td> <td>→</td> <td><img src="./images/wall_after.png"></td></tr></table></p>\r
+            <p>四角の中央をクリックすると詳細を入力できます。<br>\r
+            <table><tr><td class="dialog"><img src="./images/note_dialog.png"></td> <td>→</td> <td><img src="./images/note_after.png"></td></tr></table></p>\r
+            <p>「ボックス形式」と「足跡形式」の違い。<br>\r
+                <table>\r
+                <tr><td>ボックス形式:</td><td><img src="./images/box_cmp_before.png"></td> <td>→</td> <td><img src="./images/box_cmp_after.png"></td></tr>\r
+                <tr><td>足跡形式:</td><td><img src="./images/grow_cmp_before.png"></td> <td>→</td> <td><img src="./images/grow_cmp_after.png"></td></tr>\r
+                </table>\r
+            </p>\r
+    </div>\r
+</body>\r
+</html>\r
diff --git a/images/wall_00.pdn b/images/wall_00.pdn
new file mode 100644 (file)
index 0000000..5201d85
Binary files /dev/null and b/images/wall_00.pdn differ
diff --git a/images/wall_01.pdn b/images/wall_01.pdn
new file mode 100644 (file)
index 0000000..b65a2f1
Binary files /dev/null and b/images/wall_01.pdn differ
diff --git a/images/wall_02.pdn b/images/wall_02.pdn
new file mode 100644 (file)
index 0000000..7f46a73
Binary files /dev/null and b/images/wall_02.pdn differ
diff --git a/images/wall_03_04.pdn b/images/wall_03_04.pdn
new file mode 100644 (file)
index 0000000..a71912d
Binary files /dev/null and b/images/wall_03_04.pdn differ
diff --git a/images/wall_05.pdn b/images/wall_05.pdn
new file mode 100644 (file)
index 0000000..78f56c6
Binary files /dev/null and b/images/wall_05.pdn differ
diff --git a/images/wall_06.pdn b/images/wall_06.pdn
new file mode 100644 (file)
index 0000000..2728dfe
Binary files /dev/null and b/images/wall_06.pdn differ
diff --git a/images/wall_07.pdn b/images/wall_07.pdn
new file mode 100644 (file)
index 0000000..ad5079d
Binary files /dev/null and b/images/wall_07.pdn differ
diff --git a/images/wall_08.pdn b/images/wall_08.pdn
new file mode 100644 (file)
index 0000000..d6990d8
Binary files /dev/null and b/images/wall_08.pdn differ
diff --git a/images/wall_09.pdn b/images/wall_09.pdn
new file mode 100644 (file)
index 0000000..6762711
Binary files /dev/null and b/images/wall_09.pdn differ
diff --git a/images/wall_h_00.png b/images/wall_h_00.png
new file mode 100644 (file)
index 0000000..bb7fd06
Binary files /dev/null and b/images/wall_h_00.png differ
diff --git a/images/wall_h_01.png b/images/wall_h_01.png
new file mode 100644 (file)
index 0000000..849762c
Binary files /dev/null and b/images/wall_h_01.png differ
diff --git a/images/wall_h_02.png b/images/wall_h_02.png
new file mode 100644 (file)
index 0000000..71a72fa
Binary files /dev/null and b/images/wall_h_02.png differ
diff --git a/images/wall_h_03.png b/images/wall_h_03.png
new file mode 100644 (file)
index 0000000..ab698ad
Binary files /dev/null and b/images/wall_h_03.png differ
diff --git a/images/wall_h_04.png b/images/wall_h_04.png
new file mode 100644 (file)
index 0000000..e3399cf
Binary files /dev/null and b/images/wall_h_04.png differ
diff --git a/images/wall_h_05.png b/images/wall_h_05.png
new file mode 100644 (file)
index 0000000..edebd0e
Binary files /dev/null and b/images/wall_h_05.png differ
diff --git a/images/wall_h_06.png b/images/wall_h_06.png
new file mode 100644 (file)
index 0000000..78588fe
Binary files /dev/null and b/images/wall_h_06.png differ
diff --git a/images/wall_h_07.png b/images/wall_h_07.png
new file mode 100644 (file)
index 0000000..98a2685
Binary files /dev/null and b/images/wall_h_07.png differ
diff --git a/images/wall_h_08.png b/images/wall_h_08.png
new file mode 100644 (file)
index 0000000..46e4b70
Binary files /dev/null and b/images/wall_h_08.png differ
diff --git a/images/wall_h_09.png b/images/wall_h_09.png
new file mode 100644 (file)
index 0000000..024b6f1
Binary files /dev/null and b/images/wall_h_09.png differ
diff --git a/images/wall_v_00.png b/images/wall_v_00.png
new file mode 100644 (file)
index 0000000..2372f08
Binary files /dev/null and b/images/wall_v_00.png differ
diff --git a/images/wall_v_01.png b/images/wall_v_01.png
new file mode 100644 (file)
index 0000000..fb9b2b6
Binary files /dev/null and b/images/wall_v_01.png differ
diff --git a/images/wall_v_02.png b/images/wall_v_02.png
new file mode 100644 (file)
index 0000000..4b5050f
Binary files /dev/null and b/images/wall_v_02.png differ
diff --git a/images/wall_v_03.png b/images/wall_v_03.png
new file mode 100644 (file)
index 0000000..89e24e6
Binary files /dev/null and b/images/wall_v_03.png differ
diff --git a/images/wall_v_04.png b/images/wall_v_04.png
new file mode 100644 (file)
index 0000000..ddc1a03
Binary files /dev/null and b/images/wall_v_04.png differ
diff --git a/images/wall_v_05.png b/images/wall_v_05.png
new file mode 100644 (file)
index 0000000..401a5d3
Binary files /dev/null and b/images/wall_v_05.png differ
diff --git a/images/wall_v_06.png b/images/wall_v_06.png
new file mode 100644 (file)
index 0000000..9db26a6
Binary files /dev/null and b/images/wall_v_06.png differ
diff --git a/images/wall_v_07.png b/images/wall_v_07.png
new file mode 100644 (file)
index 0000000..f32156a
Binary files /dev/null and b/images/wall_v_07.png differ
diff --git a/images/wall_v_08.png b/images/wall_v_08.png
new file mode 100644 (file)
index 0000000..441d1f1
Binary files /dev/null and b/images/wall_v_08.png differ
diff --git a/images/wall_v_09.png b/images/wall_v_09.png
new file mode 100644 (file)
index 0000000..3bd89e4
Binary files /dev/null and b/images/wall_v_09.png differ
diff --git a/makeexe.bat b/makeexe.bat
new file mode 100644 (file)
index 0000000..0cf6ec7
--- /dev/null
@@ -0,0 +1,3 @@
+c:\python27\python.exe C:\python\pyinstaller-2.0\pyinstaller.py --onefile --windowed .\pydun.py\r
+copy .\dist\pydun.exe .\\r
+pause\r
diff --git a/pydun.exe b/pydun.exe
new file mode 100644 (file)
index 0000000..ec87825
Binary files /dev/null and b/pydun.exe differ