Changeset 939 for trunk/GSASIIpath.py
- Timestamp:
- Jun 2, 2013 11:07:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIpath.py ¶
r772 r939 1 1 # -*- coding: utf-8 -*- 2 '''Routines for dealing with file locations, etc.3 2 ''' 3 *GSASIIpath: locations & updates* 4 --------------------------------- 5 6 Routines for dealing with file locations, etc. 7 8 Determines the location of the compiled (.pyd or .so) libraries. 9 10 Interfaces with subversion (svn): 11 Determine the subversion release number by determining the highest version number 12 where :func:`SetVersionNumber` is called (best done in every GSASII file). 13 Other routines will update GSASII from the subversion server if svn can be 14 found. 15 ''' 16 4 17 import os 5 18 import sys … … 41 54 version = -1 42 55 def SetVersionNumber(RevString): 43 '''RevString is something like "$Revision$" that is set by subversion when 44 the file is retrieved from subversion. 56 '''Set the subversion version number 57 58 :param str RevString: something like "$Revision$" 59 that is set by subversion when the file is retrieved from subversion. 60 61 Place ``GSASIIpath.SetVersionNumber("$Revision$")`` in every python 62 file. 45 63 ''' 46 64 try: … … 52 70 53 71 def GetVersionNumber(): 72 '''Return the maximum version number seen in :func:`SetVersionNumber` 73 ''' 54 74 return version 55 75 … … 59 79 Searches the current path as well as subdirectory "svn" and 60 80 "svn/bin" in the location of the GSASII source files. 61 returns None if svn is not found. 81 82 :returns: None if svn is not found. 62 83 ''' 63 84 def is_exe(fpath): … … 77 98 or contacts the subversion server to get the latest update version (# of Head). 78 99 79 parameters: 80 fpath: path to repository dictionary, defaults to directory where 100 :param fpath: path to repository dictionary, defaults to directory where 81 101 the current file is located 82 local: determines the type of version number, where102 :param local: determines the type of version number, where 83 103 True (default): returns the latest installed update 84 104 False: returns the version number of Head on the server 85 105 86 Returns that number as an str. 87 88 Returns None if there is a subversion error (likely because the path is 106 :Returns: the version number as an str or 107 None if there is a subversion error (likely because the path is 89 108 not a repository or svn is not found) 90 109 ''' … … 114 133 the list has length 0 115 134 116 parameter: 117 fpath: path to repository dictionary, defaults to directory where 135 :param fpath: path to repository dictionary, defaults to directory where 118 136 the current file is located 119 137 120 ReturnsNone if there is a subversion error (likely because the path is138 :returns: None if there is a subversion error (likely because the path is 121 139 not a repository or svn is not found) 140 122 141 ''' 123 142 import subprocess … … 139 158 '''This performs an update of the files in a local directory from a server. 140 159 141 parameter: 142 fpath: path to repository dictionary, defaults to directory where 160 :param fpath: path to repository dictionary, defaults to directory where 143 161 the current file is located 144 162 145 Returns: 146 A dictionary with the files that have been changed/added and 147 a code describing how they have been updated (see changetype) 148 149 None if there is a subversion error (likely because the path is 163 :returns: A dictionary with the files that have been changed/added and 164 a code describing how they have been updated (see changetype) ro 165 None if there is a subversion error (likely because the path is 150 166 not a repository or svn is not found) 167 151 168 ''' 152 169 import subprocess
Note: See TracChangeset
for help on using the changeset viewer.