-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathaddProjectToGitosis.py
66 lines (36 loc) · 911 Bytes
/
addProjectToGitosis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python
'''Purpose of this module is to allow programmatic access to the gitosis.conf file
Inputs are:
file - gitosis.conf file path
group - the group you want to update
project - the name of the project you want to add
'''
file = ""
group = ""
project = ""
def addProject():
gitosisFile = open(file, 'r')
for line in gitosisFile:
if isGroupLine(line):
def main():
setValidateArgs(sys.argv)
addProject()
def setValidateArgs(args):
global file
global group
global project
incorrectNumArgs = false
fail = false
if len(args) != 4:
incorrectNumArgs = true
if incorrectNumArgs:
fail = true
print "Incorrect number of args, should be 3 was: " + str(len(args))
file = args[1]
group = args[2]
project = args[3]
import re
import sys
import os
if __name__ == '__main__':
main()