Bläddra i källkod

There is now a downloadable free trial for Luminotes Desktop. Also made export plugins work on Windows.

master
Dan Helfman 10 år sedan
förälder
incheckning
81388ed36b
12 ändrade filer med 111 tillägg och 22 borttagningar
  1. 2
    1
      NEWS
  2. 1
    0
      config/Version.py
  3. 3
    1
      controller/Root.py
  4. 2
    3
      plugins/Invoke.py
  5. 3
    0
      plugins/__init__.py
  6. 7
    1
      setup.py
  7. 11
    0
      static/css/product.css
  8. 7
    0
      static/css/style.css
  9. Binär
      static/images/trial_button.png
  10. Binär
      static/images/trial_button.xcf
  11. 62
    12
      view/Download_page.py
  12. 13
    4
      view/Header.py

+ 2
- 1
NEWS Visa fil

@@ -1,4 +1,4 @@
1
-1.6.7: ?
1
+1.6.7: February 23, 2009
2 2
  * When you export your notebook as an HTML or CSV file, the saved filename is
3 3
    now based on the name of your notebook, for instance "my-to-do-list.html"
4 4
    or "ideas-for-my-novel.csv".
@@ -6,6 +6,7 @@
6 6
  * Converted the existing HTML and CSV export features to work as separate
7 7
    export plugins. This means that a new export format can be implemented as
8 8
    a new plugin.
9
+ * There is now a downloadable free trial for Luminotes Desktop!
9 10
 
10 11
 1.6.6: February 16, 2009
11 12
  * Luminotes now recognizes "mailto:" links as external links, so you can

+ 1
- 0
config/Version.py Visa fil

@@ -1 +1,2 @@
1 1
 VERSION = u"1.6.7"
2
+TRIAL = True

+ 3
- 1
controller/Root.py Visa fil

@@ -361,7 +361,9 @@ class Root( object ):
361 361
       result[ "first_notebook" ] = None
362 362
 
363 363
     result[ "download_products" ] = self.__settings[ u"global" ].get( u"luminotes.download_products" )
364
-    result[ "upgrade" ] = upgrade
364
+
365
+    referer = cherrypy.request.headerMap.get( u"Referer" )
366
+    result[ "upgrade" ] = upgrade or ( referer and u"localhost:" in referer )
365 367
 
366 368
     return result
367 369
 

+ 2
- 3
plugins/Invoke.py Visa fil

@@ -3,8 +3,7 @@ import plugins
3 3
 
4 4
 def invoke( plugin_type, plugin_name, *args, **kwargs ):
5 5
   plugin_name = u"%s_%s" % ( plugin_type, plugin_name )
6
-  plugin_location = imp.find_module( plugin_name, plugins.__path__ )
7
-  plugin_module = imp.load_module( plugin_name, *plugin_location )
8
-
6
+  plugin_module = getattr( plugins, plugin_name )
9 7
   function = getattr( plugin_module, plugin_type )
8
+
10 9
   return apply( function, args, kwargs )

+ 3
- 0
plugins/__init__.py Visa fil

@@ -0,0 +1,3 @@
1
+# for the benefit of py2exe
2
+import export_html
3
+import export_csv

+ 7
- 1
setup.py Visa fil

@@ -1,6 +1,7 @@
1 1
 #!/usr/bin/python
2 2
 
3 3
 import os
4
+import os.path
4 5
 import sys
5 6
 from glob import glob
6 7
 from distutils.core import setup, Distribution
@@ -148,6 +149,11 @@ class InnoScript:
148 149
     print >> ofi, r"end;"
149 150
 
150 151
   def compile(self):
152
+    import os
153
+    if os.environ.get( "CYGWIN" ):
154
+      print "Running in Cygwin, so skipping compile"
155
+      return
156
+
151 157
     try:
152 158
       import ctypes
153 159
     except ImportError:
@@ -276,7 +282,7 @@ setup(
276 282
   options = dict(
277 283
     py2exe = dict(
278 284
       packages = "cherrypy.filters",
279
-      includes = "email.header,simplejson",
285
+      includes = "email.header,simplejson,plugins.*",
280 286
       compressed = 1,
281 287
       optimize = 2,
282 288
     )

+ 11
- 0
static/css/product.css Visa fil

@@ -498,6 +498,11 @@
498 498
   padding-bottom: 0.5em;
499 499
 }
500 500
 
501
+.trial_button_area {
502
+  padding-top: 1em;
503
+  padding-bottom: 0.5em;
504
+}
505
+
501 506
 .download_button_area {
502 507
   padding-top: 1em;
503 508
   padding-bottom: 0.5em;
@@ -543,3 +548,9 @@
543 548
   margin-bottom: 0.5em;
544 549
   border: 1px solid #999999;
545 550
 }
551
+
552
+.tiny_text {
553
+  font-size: 60%;
554
+  line-height: 140%;
555
+  font-weight: normal;
556
+}

+ 7
- 0
static/css/style.css Visa fil

@@ -1233,3 +1233,10 @@ h1 {
1233 1233
   font-size: 72%;
1234 1234
   font-weight: normal;
1235 1235
 }
1236
+
1237
+.trial_upgrade_link {
1238
+  font-weight: bold;
1239
+  background-color: #ffcc66;
1240
+  padding: 0.5em;
1241
+  font-size: 110%;
1242
+}

Binär
static/images/trial_button.png Visa fil


Binär
static/images/trial_button.xcf Visa fil


+ 62
- 12
view/Download_page.py Visa fil

@@ -8,7 +8,7 @@ class Download_page( Product_page ):
8 8
     MEGABYTE = 1024 * 1024
9 9
 
10 10
     # for now, just assume there's a single download package
11
-    download_button = download_products[ 0 ].get( "button" )
11
+    download_button = download_products[ 0 ].get( "button" ).strip()
12 12
     news_url = u"http://luminotes.com/hg/luminotes/file/%s/NEWS" % VERSION
13 13
 
14 14
     Product_page.__init__(
@@ -66,14 +66,16 @@ class Download_page( Product_page ):
66 66
                       class_ = u"version_text",
67 67
                     ),
68 68
                     class_ = u"plan_name_area download_plan_width",
69
-                  )
69
+                    colspan = "2",
70
+                  ),
70 71
                 ),
71
-                Tr( Td(), class_ = u"spacer_row" ),
72
+                Tr( Td( colspan = "2" ), class_ = u"spacer_row" ),
72 73
                 Tr(
73 74
                   Td(
74 75
                     Span( u"Solo", class_ = u"highlight" ), u"note taking",
75 76
                     title = u"Luminotes Desktop is designed for individuals.",
76 77
                     class_ = u"feature_value",
78
+                    colspan = "2",
77 79
                   ),
78 80
                 ),
79 81
                 Tr(
@@ -81,6 +83,7 @@ class Download_page( Product_page ):
81 83
                     u"Runs on your", Span( u"own computer", class_ = u"highlight" ),
82 84
                     title = u"All of your notes are stored privately on your own computer or on a USB drive.",
83 85
                     class_ = u"feature_value",
86
+                    colspan = "2",
84 87
                   ),
85 88
                 ),
86 89
                 Tr(
@@ -88,6 +91,7 @@ class Download_page( Product_page ):
88 91
                     Span( u"Unlimited", class_ = u"highlight" ), u"storage",
89 92
                     title = u"Add as many notes, documents, and files as you want.",
90 93
                     class_ = u"feature_value",
94
+                    colspan = "2",
91 95
                   ),
92 96
                 ),
93 97
                 Tr(
@@ -95,30 +99,57 @@ class Download_page( Product_page ):
95 99
                     u"Works", Span( "offline", class_ = u"highlight" ),
96 100
                     title = u"Take notes in meetings, in class, or while on the go. Runs in a web browser, but doesn't need an internet connection.",
97 101
                     class_ = u"feature_value",
102
+                    colspan = "2",
98 103
                   ),
99 104
                 ),
100
-                Tr( Td(), class_ = u"spacer_row" ),
105
+                Tr( Td( colspan = "2" ), class_ = u"spacer_row" ),
101 106
                 Tr(
102 107
                   Td(
103 108
                     u"Windows XP/Vista,", A( u"Linux source", href = u"/source_code" ),
104 109
                     class_ = u"small_text",
110
+                    colspan = "2",
105 111
                   ),
106 112
                 ),
107 113
                 Tr(
108 114
                   Td(
109 115
                     u"Firefox 2+, Internet Explorer 7+, Chrome 1+, Safari 3+",
110 116
                     class_ = u"small_text",
117
+                    colspan = "2",
111 118
                   ),
112 119
                 ),
120
+                Tr( Td( colspan = "2" ), class_ = u"spacer_row" ),
113 121
                 Tr(
114
-                  Td(
122
+                  ( not upgrade ) and Td(
123
+                    Div(
124
+                      A(
125
+                        Img(
126
+                          src = u"/static/images/trial_button.png",
127
+                          width = u"107", height = u"26",
128
+                          alt = u"download trial",
129
+                        ),
130
+                        href = "/static/luminotes.exe",
131
+                      ),
132
+                      Div(
133
+                        u"Completely free",
134
+                        class_ = u"tiny_text",
135
+                      ),
136
+                      class_ = u"trial_button_area",
137
+                    ),
138
+                    colspan = download_button and "1" or "2",
139
+                  ) or None,
140
+                  download_button and Td(
115 141
                     Div(
116 142
                       download_button,
143
+                      Div(
144
+                        u"Fast and secure",
145
+                        class_ = u"tiny_text",
146
+                      ),
117 147
                       class_ = u"download_button_area",
118 148
                     ),
119
-                  ),
149
+                    colspan = upgrade and "2" or "1",
150
+                  ) or None,
120 151
                 ),
121
-                Tr( Td(), class_ = u"spacer_row" ),
152
+                Tr( Td( colspan = "2" ), class_ = u"spacer_row" ),
122 153
                 border = u"1",
123 154
                 id = u"upgrade_table",
124 155
               ),
@@ -165,12 +196,15 @@ class Download_page( Product_page ):
165 196
             H4( u"Can I try before I buy?", class_ = u"upgrade_question" ),
166 197
             P(
167 198
               """
168
-              Sure! Just check out the full-featured
199
+              Sure! Just
200
+              """,
201
+              A( u"download the full-featured free trial", href = "/static/luminotes.exe" ),
202
+              """
203
+              or check out the
169 204
               """,
170 205
               A( u"online demo", href = "/users/demo" ),
171 206
               """
172
-              to see Luminotes for yourself. The only difference is that Luminotes Desktop runs in
173
-              a browser on your own computer instead of on the web.
207
+              to see Luminotes for yourself.
174 208
               """,
175 209
               class_ = u"upgrade_text",
176 210
             ),
@@ -221,15 +255,31 @@ class Download_page( Product_page ):
221 255
                 Th(
222 256
                   Span( u"Luminotes Desktop", class_ = u"plan_name" ),
223 257
                   class_ = u"plan_name_area",
258
+                  colspan = "2",
224 259
                 )
225 260
               ),
226 261
               Tr(
227
-                Td(
262
+                ( not upgrade ) and Td(
263
+                  Div(
264
+                    A(
265
+                      Img(
266
+                        src = u"/static/images/trial_button.png",
267
+                        width = u"107", height = u"26",
268
+                        alt = u"download trial",
269
+                      ),
270
+                      href = "/static/luminotes.exe",
271
+                    ),
272
+                    class_ = u"trial_button_area",
273
+                  ),
274
+                  colspan = download_button and "1" or "2",
275
+                ) or None,
276
+                download_button and Td(
228 277
                   Div(
229 278
                     download_button,
230 279
                     class_ = u"download_button_area",
231 280
                   ),
232
-                ),
281
+                  colspan = upgrade and "2" or "1",
282
+                ) or None,
233 283
               ),
234 284
               id = u"upgrade_table_small",
235 285
             ),

+ 13
- 4
view/Header.py Visa fil

@@ -1,5 +1,5 @@
1
-from Tags import Div, A, Img, Span
2
-from config.Version import VERSION
1
+from Tags import Div, A, Img, Span, B
2
+from config.Version import VERSION, TRIAL
3 3
 
4 4
 class Header( Div ):
5 5
   def __init__( self, user, first_notebook, login_url, logout_url, note_title, rate_plan = None ):
@@ -9,6 +9,15 @@ class Header( Div ):
9 9
       alt = u"Luminotes",
10 10
     )
11 11
 
12
+    trial_expired = False
13
+    if TRIAL:
14
+      from pytz import utc
15
+      from datetime import datetime, timedelta
16
+      
17
+      trial_age = datetime.now( tz = utc ) - first_notebook.revision
18
+      if trial_age > timedelta( days = 30 ):
19
+        trial_expired = True
20
+
12 21
     if rate_plan and rate_plan.get( u"name" ) == u"desktop":
13 22
       Div.__init__(
14 23
         self,
@@ -16,8 +25,8 @@ class Header( Div ):
16 25
           ( note_title == u"home" ) and title_image or
17 26
             A( title_image, href = u"http://luminotes.com/", target = "_new" ),
18 27
           Div(
19
-            u"version", VERSION, u" | ",
20
-            A( u"upgrade", href = u"http://luminotes.com/download?upgrade=True", target = "_new" ), u" | ",
28
+            ( TRIAL and u"trial" or u"" ), u"version", VERSION, u" | ",
29
+            A( u"upgrade", href = u"http://luminotes.com/download", target = "_new", class_ = trial_expired and "trial_upgrade_link" or u"" ), u" | ",
21 30
             A( u"community", href = u"http://luminotes.com/community", target = "_new" ), u" | ",
22 31
             A( u"blog", href = u"http://luminotes.com/blog/", target = "_new" ), u" | ",
23 32
             A( u"close", href = u"/close" ),

Laddar…
Avbryt
Spara