Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Do not check for presence of P4 environment variables

Allows for use of a P4CONFIG file to set the required variables.
  • Loading branch information...
commit 99d0e35f9383e1415107e23d7d1047167ab55cea 1 parent 09ae05b
squatch authored February 15, 2013 infininight committed February 18, 2013

Showing 1 changed file with 9 additions and 25 deletions. Show diff stats Hide diff stats

  1. 34  Support/perforce_bundle_helper.py
34  Support/perforce_bundle_helper.py
@@ -4,34 +4,18 @@
4 4
 p4 = None
5 5
 
6 6
 def connect_to_p4():
7  
-	required_environ_keys = ['P4PORT', 'P4USER', 'P4PASSWD', 'P4CLIENT']
  7
+	global p4
8 8
 	
9  
-	missing_environ_keys = filter(
10  
-		lambda key: not os.environ.has_key(key),
11  
-		required_environ_keys 
12  
-	)
13  
-	
14  
-	if missing_environ_keys:
15  
-		print("Please make sure that the following environment variables have been set:")
16  
-		
17  
-		for key in missing_environ_keys:
18  
-			print(" - " + key)
  9
+	if p4 is None:
  10
+		p4 = P4()
19 11
 		
20  
-		print('')
21  
-		assert False
22  
-	else:
23  
-		global p4
24  
-		
25  
-		if p4 is None:
26  
-			p4 = P4()
  12
+	if not p4.connected():
  13
+		try:
  14
+			p4.connect()
  15
+		except P4Exception as p4_error:
  16
+			print(p4_error)
27 17
 			
28  
-		if not p4.connected():
29  
-			try:
30  
-				p4.connect()
31  
-			except P4Exception as p4_error:
32  
-				print(p4_error)
33  
-				
34  
-		return p4
  18
+	return p4
35 19
 
36 20
 
37 21
 def get_textmate_file_list():

0 notes on commit 99d0e35

Please sign in to comment.
Something went wrong with that request. Please try again.