Revision: 7ad8f40f9045
Author:   Pekka Klärck
Date:     Fri Jan 13 03:40:38 2012
Log:      Merged branch `newinstall`.

Update issue 480
Status: Started
Owner: pekka.klarck
New installation system is now implemented. Requires testing and documentation changes.
http://code.google.com/p/robotframework/source/detail?r=7ad8f40f9045

Modified:
 /setup.py
 /src/robot/rebot.py
 /utest/reporting/test_jsonwriter.py

=======================================
--- /setup.py   Thu Jan 12 04:08:12 2012
+++ /setup.py   Fri Jan 13 03:40:38 2012
@@ -2,11 +2,10 @@

 import sys
 import os
+from os.path import join, dirname
 from distutils.core import setup

-import robot_postinstall
-execfile(os.path.join(os.path.dirname(__file__),'src','robot','version.py'))
-
+execfile(join(dirname(__file__), 'src', 'robot', 'version.py'))

 # Maximum width in Windows installer seems to be 70 characters -------|
 DESCRIPTION = """
@@ -17,63 +16,46 @@
 libraries implemented either with Python or Java, and users can create
 new keywords from existing ones using the same syntax that is used for
 creating test cases.
-"""[1:-1]
+""".strip()
 CLASSIFIERS = """
 Development Status :: 5 - Production/Stable
 License :: OSI Approved :: Apache Software License
 Operating System :: OS Independent
 Programming Language :: Python
 Topic :: Software Development :: Testing
-"""[1:-1]
+""".strip().splitlines()
 PACKAGES = ['robot', 'robot.api', 'robot.common', 'robot.conf',
             'robot.libraries', 'robot.model', 'robot.output', 'robot.parsing',
             'robot.result', 'robot.reporting', 'robot.running',
             'robot.running.timeouts', 'robot.utils', 'robot.variables',
             'robot.writer']
-SCRIPT_NAMES = ['pybot', 'jybot', 'rebot']
-if os.name == 'java':
-    SCRIPT_NAMES.remove('pybot')
-
-
-def main():
- inst_scripts = [ os.path.join('src','bin',name) for name in SCRIPT_NAMES ]
-    if 'bdist_wininst' in sys.argv:
-        inst_scripts = [ script+'.bat' for script in inst_scripts ]
-        inst_scripts.append('robot_postinstall.py')
-    elif os.sep == '\\':
-        inst_scripts = [ script+'.bat' for script in inst_scripts ]
-
-    if 'bdist_egg' in sys.argv:
-        package_path = os.path.dirname(sys.argv[0])
-        robot_postinstall.egg_preinstall(package_path, inst_scripts)
-
-    # Let distutils take care of most of the setup
-    dist = setup(
-          name         = 'robotframework',
-          version      = get_version(sep=''),
-          author       = 'Robot Framework Developers',
-          author_email = '[email protected]',
-          url          = 'http://robotframework.org',
-          license      = 'Apache License 2.0',
-          description  = 'A generic test automation framework',
-          long_description = DESCRIPTION,
-          keywords     = 'robotframework testing testautomation atdd',
-          platforms    = 'any',
-          classifiers  = CLASSIFIERS.splitlines(),
-          package_dir  = {'': 'src'},
- package_data = {'robot': ['webcontent/*.html', 'webcontent/*.css', 'webcontent/*.js', 'webcontent/lib/*.js']},
-          packages     = PACKAGES,
-          scripts      = inst_scripts,
-    )
-
-    if 'install' in sys.argv:
-        absnorm = lambda path: os.path.abspath(os.path.normpath(path))
- script_dir = absnorm(dist.command_obj['install_scripts'].install_dir)
-        module_dir = absnorm(dist.command_obj['install_lib'].install_dir)
-        robot_dir = os.path.join(module_dir, 'robot')
-        script_names = [ os.path.basename(name) for name in inst_scripts ]
- robot_postinstall.generic_install(script_names, script_dir, robot_dir)
-
-
-if __name__ == "__main__":
-    main()
+PACKAGE_DATA = ['webcontent/'+p for p in '*.html', '*.css', '*.js', 'lib/*.js']
+if sys.platform.startswith('java'):
+    SCRIPTS = ['jybot', 'jyrebot']
+elif sys.platform == 'cli':
+    SCRIPTS = ['ipybot', 'ipyrebot']
+else:
+    SCRIPTS = ['pybot', 'rebot']
+SCRIPTS = [join('src', 'bin', s) for s in SCRIPTS]
+if os.sep == '\\':
+    SCRIPTS = [s+'.bat' for s in SCRIPTS]
+if 'bdist_wininst' in sys.argv:
+    SCRIPTS.append('robot_postinstall.py')
+
+setup(
+    name         = 'robotframework',
+    version      = get_version(sep=''),
+    author       = 'Robot Framework Developers',
+    author_email = '[email protected]',
+    url          = 'http://robotframework.org',
+    license      = 'Apache License 2.0',
+    description  = 'A generic test automation framework',
+    long_description = DESCRIPTION,
+    keywords     = 'robotframework testing testautomation atdd',
+    platforms    = 'any',
+    classifiers  = CLASSIFIERS,
+    package_dir  = {'': 'src'},
+    package_data = {'robot': PACKAGE_DATA},
+    packages     = PACKAGES,
+    scripts      = SCRIPTS,
+)
=======================================
--- /src/robot/rebot.py Wed Nov  2 04:02:27 2011
+++ /src/robot/rebot.py Fri Jan 13 03:40:38 2012
@@ -14,7 +14,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.

-"""Rebot -- Robot Framework Report and Log Generator
+DOC = """Rebot -- Robot Framework Report and Log Generator

 Version: <VERSION>

@@ -252,5 +252,6 @@


 if __name__ == '__main__':
-    rc = robot.rebot_from_cli(sys.argv[1:], __doc__)
+    # TODO: rebot_from_cli should not need DOC
+    rc = robot.rebot_from_cli(sys.argv[1:], DOC)
     sys.exit(rc)

Reply via email to