Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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 squatch authored infininight committed
Showing with 9 additions and 25 deletions.
  1. +9 −25 Support/perforce_bundle_helper.py
View
34 Support/perforce_bundle_helper.py
@@ -4,34 +4,18 @@
p4 = None
def connect_to_p4():
- required_environ_keys = ['P4PORT', 'P4USER', 'P4PASSWD', 'P4CLIENT']
+ global p4
- missing_environ_keys = filter(
- lambda key: not os.environ.has_key(key),
- required_environ_keys
- )
-
- if missing_environ_keys:
- print("Please make sure that the following environment variables have been set:")
-
- for key in missing_environ_keys:
- print(" - " + key)
+ if p4 is None:
+ p4 = P4()
- print('')
- assert False
- else:
- global p4
-
- if p4 is None:
- p4 = P4()
+ if not p4.connected():
+ try:
+ p4.connect()
+ except P4Exception as p4_error:
+ print(p4_error)
- if not p4.connected():
- try:
- p4.connect()
- except P4Exception as p4_error:
- print(p4_error)
-
- return p4
+ return p4
def get_textmate_file_list():
Please sign in to comment.
Something went wrong with that request. Please try again.