Changeset 219
- Timestamp:
- Sat Oct 7 14:54:24 2006
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
-
server/trunk/update/client/Share Changes with Server.py
r194 r219 66 66 server_address = Data.Other.get('ServerAddress') # or "http://192.168.0.6:8001" 67 67 if not server_address: 68 Data.Hint("%s: %s" % ( thisfile, _("Database not on a server.")))68 Data.Hint("%s: %s" % (scriptname, _("Database not on a server."))) 68 68 return 69 69 … … 144 144 changes, version, new_server_nextid = server.get_updates_since(parms, lastChange, rows_needed) 145 145 if debug: print changes, version, new_server_nextid 146 146 146 146 # new_server_nextid is a dict with this format: 147 147 # { tablename: (row_after_last_reserved) } … … 224 224 Data.NextID["_" + k] = v # the server's next id (same as ours now) 225 225 if not Data.Database.has_key(k): # new table we knew not of 226 Database[k] = {} 226 Data.Database[k] = {} 226 226 227 227 return changes, version … … 320 320 if new_value or new_value == 0: 321 321 row[k] = new_value # set new value 322 else: 323 if row[k]: 324 del row[k] # delete new value 322 elif k in row: 323 del row[k] # delete new value 325 324 326 325 #Data.Update(c_new, 0) # should we not use update to apply changes? … … 330 329 331 330 for k in c_old: 332 if k in row_old: 333 if row.has_key("_" + k): # so script can be used with v0.6 334 del row["_" + k] # remove 'changed' flag from updated records 335 # I encountered and error where this key didn't exist on 060326 336 # was I using v0.6 when I hit this error? if so then the above should fix it 331 if row.has_key("_" + k): # so script can be used with v0.6 332 del row["_" + k] # remove 'changed' flag from updated records 337 333 # Data.SetUndo("Applied Changes from Server") # To refresh display, but shouldn't allow undo??? <-- TO DO 338 334 # PROBLEM <- if this adds rows? I don't want to add rows until after we send updates to server. … … 527 523 for id, record in t.iteritems(): # each row 528 524 for k in record.keys(): # each column 529 if k[0] == '_' and k[ 1] != '_': # delete just the single dash?525 if k[0] == '_' and k[:2] != '__': # delete just the single dash? 529 525 del record[k] 530 526 return -
server/trunk/update/client/Add Database to Server.py
r195 r219 66 66 for tid, t in tables: 67 67 if tid[0] == "_": continue # skip internal tables, if any 68 if tid == 'Next': continue # server can't handle because it doesn't containt 'ID'69 68 70 69 alias = None # identify aliases (thanks for the code Alex!) … … 80 79 81 80 if tid in ["NextID", ]: # special tables, include "Other"??? 82 exceptions[tid] = t 81 for col, v in data.items(): 82 if col[0] == "_": del data[col] 83 if v is None: 84 if debug: print "Deleting None item from: ", tid, col 85 del data[col] 86 exceptions[tid] = t 83 87 continue 84 88 89 for rid, data in t.items(): # get rid of Nones for xmlrpclib 90 for col, v in data.items(): 91 if col[0] == "_": del data[col] 92 if v is None: 93 if debug: 94 print "Deleting None item from: ", tid, rid, col 95 del data[col] 96 85 97 # most tables can be handled like this? 86 98 normal[tid] = t.values() # list of values (id's are in the records) … … 107 119 108 120 webfile = Data.Other['WebFileKey'] 109 text = _("""The database was added to the server. If you would like someone to be able 110 to download the database or access the database via the web, send them one one 111 or more of the following. 121 text = _("""The database was added to the server. If you would like someone to be able to download the database or access the database via the web, send them one one or more of the following. 112 122 113 123 IMPORTANT: Before sending the web instructions be sure to insert the actual URL they should use. 114 124 ---- 115 Before you download a database from the GanttPV Server, you will need to install 116 the GanttPV Server client scripts into the Scripts folder. Then follow these 117 instructions: 125 Before you download a database from the GanttPV Server, you will need to install the GanttPV Server client scripts into the Scripts folder. Then follow these instructions: 118 126 119 127 (1) Open GanttPV … … 127 135 128 136 (1) Open the GanttPV Server Web Page at this URL: 129 ( -- REPLACE this with the actual URL.-- Get itfrom the person who installs GanttPV on the web server.)137 (Replace this with the actual URL from the person who installs GanttPV on the web server.) 129 137 (2) Copy and paste the following key to display the reports: 130 138 %s%s … … 135 143 136 144 (1) Open the GanttPV Server Web Page at this URL: 137 ( -- REPLACE this with the actual URL.-- Get itfrom the person who installs GanttPV on the web server.)145 (Replace this with the actual URL from the person who installs GanttPV on the web server.) 137 145 (2) Copy and paste the following key to display the reports: 138 146 %s%s
