Kirill Simonov avatar Kirill Simonov committed 76c8594

Minor updates to the legal notice and use the same text in the shell Help
screen.

Comments (0)

Files changed (10)

src/htsql/__init__.py

           see ``AUTHORS`` file in the source distribution
           for the full list of contributors
 
-This package provides HTSQL, a query language for the accidental programmer.
+This package provides HTSQL, a comprehensive navigational query language for
+relational databases.
 
 HTSQL is implemented as a WSGI application.  To create an application, run::
 
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  This software
 is released under the AGPLv3 as well as a permissive license for use
-with open source databases.  See http://htsql.org/license/
+with open source databases.  See http://htsql.org/license/.
 
-The HTSQL language and implementation was developed by members 
-of the HTSQL Project (http://htsql.org).
+The HTSQL language and implementation were developed by members
+of the HTSQL Project (http://htsql.org/).
 """
+__legal__ = """\
+HTSQL %(__version__)s
+%(__copyright__)s
+%(__license__)s""" % vars()
+
 
 from .core.application import Application as HTSQL
 

src/htsql/ctl/__init__.py

     Run `%(executable)s help <routine>` for help on a specific routine.
     """
 
-    def get_version(self):
-        import htsql
-        return "%s %s" % (htsql.__name__.upper(), htsql.__version__)
-
     def get_copyright(self):
         import htsql
         return trim_doc(htsql.__copyright__)
 
-    def get_license(self):
+    def get_legal(self):
         import htsql
-        return trim_doc(htsql.__license__)
+        return trim_doc(htsql.__legal__)
 
-    def get_appropriate_legal_notices(self):
-        notices = []
-        version = self.get_version()
-        if version is not None:
-            notices.append(version)
-        copyright = self.get_copyright()
-        if copyright is not None:
-            notices.append(copyright)
-        license = self.get_license()
-        if license is not None:
-            notices.append(license)
-        return "\n".join(notices)
 
 def main():
     # This function is called when the `htsql-ctl` script is started.

src/htsql/ctl/script.py

         """
         Returns a copyright notice.
         """
-        return None
+        raise NotImplementedError()
 
-    def get_license(self):
+    def get_legal(self):
         """
-        Returns licensing information.
+        Returns the application version, copyright and licensing notices.
         """
-        return None
-
-    def get_version(self):
-        """
-        Returns version information.
-        """
-        return None
+        raise NotImplementedError()
 
     def parse_argv(self, argv):
         # Parses the command-line arguments; returns a triple:

src/htsql/ctl/shell.py

     """
 
     def execute(self):
-        self.ctl.out(self.ctl.get_appropriate_legal_notices())
+        self.ctl.out(self.ctl.get_legal())
         self.ctl.out()
 
 class DescribeCmd(Cmd):

src/htsql/ctl/version.py

     """
 
     def run(self):
-        self.ctl.out(self.ctl.get_appropriate_legal_notices())
+        self.ctl.out(self.ctl.get_legal())
         self.ctl.out()

src/htsql/tweak/shell/command.py

 #
 
 
-from ... import __version__
+from ... import __version__, __legal__
 from ...core.util import maybe, listof
 from ...core.context import context
 from ...core.adapter import Adapter, adapts, named
         assert resource is not None
         database_name = context.app.htsql.db.database
         htsql_version = __version__
+        htsql_legal = __legal__
         server_root = context.app.tweak.shell.server_root
         if server_root is None:
             server_root = wsgiref.util.application_uri(self.action.environ)
         data = self.patch(data, 'base href', resource_root)
         data = self.patch(data, 'data-database-name', database_name)
         data = self.patch(data, 'data-htsql-version', htsql_version)
+        data = self.patch(data, 'data-htsql-legal', htsql_legal)
         data = self.patch(data, 'data-server-root', server_root)
         data = self.patch(data, 'data-query-on-start', query_on_start)
         data = self.patch(data, 'data-evaluate-on-start', evaluate_on_start)

src/htsql/tweak/shell/static/index.html

 
   <body data-database-name="HTSQL"
         data-htsql-version="2.0"
+        data-htsql-legal="Copyright (c) 2006-2012, Prometheus Research, LLC"
         data-server-root="http://localhost:8080"
         data-query-on-start="/"
         data-evaluate-on-start="false"
             <dt>CTRL+SPACE</dt>
             <dd>auto-complete table, column and link names</dd>
           </dl>
-          <p>For more information, please visit http://htsql.org</p>
-          <pre id="appropriate-legal-notices">
-Copyright (c) 2006-2012, Prometheus Research, LLC
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.  This software
-is released under the AGPLv3 as well as a permissive license for use
-with open source databases.  See http://htsql.org/license/
-          </pre>
-          <a href="http://htsql.org"><img src="htsql_88x31.png"/></a>
+          <p>For more information, please visit http://htsql.org/.</p>
+          <pre id="legal" class="legal">Copyright (c) 2006-2012, Prometheus Research, LLC</pre>
+          <div class="banner"><img src="./htsql_88x31.png"/></div>
         </div>
       </div>
     </div>

src/htsql/tweak/shell/static/shell.css

   color: #1a1a1a;
 }
 
-#help-popup pre {
-   padding-top: 30px;
-   padding-left: 20px;
-   font-size: 80%
+#help-popup .legal {
+  font-size: 80%;
+  margin: 2em 2em 1em;
 }
 
-#help-popup img {
-   float: right;
-   position: relative;
-   right: 0;
-   bottom: 0;
+#help-popup .banner {
+  position: relative;
 }
+
+#help-popup .banner img {
+  position: absolute;
+  right: 0.5em;
+  bottom: 0.5em;
+}
+

src/htsql/tweak/shell/static/shell.js

         return {
             databaseName: $body.attr('data-database-name') || "",
             htsqlVersion: $body.attr('data-htsql-version') || "",
+            htsqlLegal: $body.attr('data-htsql-legal') || "",
             serverRoot: $body.attr('data-server-root') || "",
             queryOnStart: $body.attr('data-query-on-start') || "/",
             evaluateOnStart: ($body.attr('data-evaluate-on-start') == 'true'),
 
     function clickHelp() {
         $('#version').text(config.htsqlVersion);
+        $('#legal').text(config.htsqlLegal);
         $popups.show();
         $helpPopup.show();
     }

test/output/routine.yaml

 
   exit: 0
 - ctl: [--version]
-  stdout: "HTSQL 2.3.0\nCopyright (c) 2006-2012, Prometheus Research, LLC\nThis is
-    free software: you are free to change and redistribute it.\nThere is NO WARRANTY,
-    to the extent permitted by law.  This software\nis released under the AGPLv3 as
-    well as a permissive license for use\nwith open source databases.  See http://htsql.org/license/\n\nThe
-    HTSQL language and implementation was developed by members \nof the HTSQL Project
-    (http://htsql.org).\n\n"
+  stdout: |+
+    HTSQL 2.3.0
+    Copyright (c) 2006-2012, Prometheus Research, LLC
+
+    This is free software: you are free to change and redistribute it.
+    There is NO WARRANTY, to the extent permitted by law.  This software
+    is released under the AGPLv3 as well as a permissive license for use
+    with open source databases.  See http://htsql.org/license/.
+
+    The HTSQL language and implementation were developed by members
+    of the HTSQL Project (http://htsql.org/).
+
   exit: 0
 - ctl: [help]
   stdout: |+
 
   exit: 0
 - ctl: [version]
-  stdout: "HTSQL 2.3.0\nCopyright (c) 2006-2012, Prometheus Research, LLC\nThis is
-    free software: you are free to change and redistribute it.\nThere is NO WARRANTY,
-    to the extent permitted by law.  This software\nis released under the AGPLv3 as
-    well as a permissive license for use\nwith open source databases.  See http://htsql.org/license/\n\nThe
-    HTSQL language and implementation was developed by members \nof the HTSQL Project
-    (http://htsql.org).\n\n"
+  stdout: |+
+    HTSQL 2.3.0
+    Copyright (c) 2006-2012, Prometheus Research, LLC
+
+    This is free software: you are free to change and redistribute it.
+    There is NO WARRANTY, to the extent permitted by law.  This software
+    is released under the AGPLv3 as well as a permissive license for use
+    with open source databases.  See http://htsql.org/license/.
+
+    The HTSQL language and implementation were developed by members
+    of the HTSQL Project (http://htsql.org/).
+
   exit: 0
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.