tappy820918 / Server_Update

Python Implemented Server Update system practice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server-Client update system

File written in Python 2.7

File structure (Initially)

  • Server side: 3 files
    • config.csv - The configuration file which stores the version from Server side.
    • Toy_setting.csv - The setting file which will be set as parameter updating for mailfile.
    • Toy.py - The main file in which we want to run and updates.
  • Client side: 1 file
    • Update.py

Run code

On server side Terminal we change to the desired directory then initiate Server :

cd /desktop/
python -m SimpleHTTPServer 8000

On client side Terminal:

cd home/ubuntu/CL_update
python Update.py

This update file program is mainly to

  1. Set up connection from client to server via http.
  2. Download and start the running background program__mainfile__ .
  3. Download setting file setting for mainfile .
  4. Update mainfile & setting if the version is higher in Server/config.csv and config.csv & file's version matches.

  • Note that in mainfile commands MUST NOT EXECUTE in IMPORTING; i.e. setif __name__ == '__main__' on the execution scripts. ( In the check_output_cmd we import version from mainfile )
  • Version setting is controled by StrictVersion soshould be set carefully in furthur __mainfile__setting

Initial Setting for Update.py

MAC = '10.137.99.226' - mac address
PORT = '8000' - port setting
configuration = 'config.csv'
mainfile = 'Toy.py'
setting = 'Toy_setting.csv'

About

Python Implemented Server Update system practice


Languages

Language:Python 100.0%