Utah.govOnline ServicesAgency ListBusiness.Utah.gov

Home arrow GIS Data & Resources arrow Scripts and Code arrow Python arrow PYTHON! data lock workaround...
PYTHON! data lock workaround... PDF Print E-mail

Written by Kevin Bell,

Do you ever need to edit data that is on the network (non SDE) but it's locked by someone else that is viewing it?  If so, this script is for you.  This one is a recombination of a few other toy scripts that I've already posted. 

If you don't have SDE, you can keep GIS data on the network for others to read (ArcReader?) and then you have a local copy that you can edit without being locked out.  Run the script below as a scheduled task and you'll be notified via email concerning the success or failure of overwriting the network data with your local copy.

import shutil, smtplib

src = r"C:\StagingDBs\Volumes.mdb"
dst = r"P:\Transportation\Maps\00Data\Volumes\Volumes.mdb"

try:
    shutil.copyfile(src, dst)
    print "successfully copied"
    message = """To: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
From: Python!
Subject: Traffic Volume Copy Status: SUCESS.

Hello,
The Traffic Studies database was successfully copied to the network."""

except:
    print "failed to copy"
    message = """To: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
From: Python!
Subject: Traffic Volume Copy Status:  FAILURE.

Hello,
The Traffic Studies database FAILED to copy to the network."""

s = smtplib.SMTP("999.99.99.99")
s.sendmail("Python!", " This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ", message)


Users' Comments  
 

No comment posted

Add your comment

23, Jun. 2008
Last Updated ( 23, Jun. 2008 )
 
< Prev   Next >

AGRC Contacts | UGIC Contacts

feed image feed image

Utah GIS Portal © 2008 AGRC

Optimized for