104 questions
0
votes
1
answer
51
views
Using the P4Python module within Adobe Painter
I'm new to Python and while I'm certain this is a Python 101 question, it has befuddled me for this last week. Im trying to write a plugin for Adobe Painter in Python and need it to interact with ...
0
votes
0
answers
34
views
Unable to recreate a deleted stream spec using P4Python API
I am doing some experiments with P4Python API, and noticed this difference in CLI vs API.
If I try to re-create a stream that I had previously deleted using p4 stream -d, the CLI is fine with that:
p4 ...
-1
votes
2
answers
64
views
How to check if file is added or in edit mode/checked out?
I'm looking for the commands for these things:
Does file exist in depo? And if so is it checked out?
Is local file added?
Thanks!
(extra info)
I've figured out the commands for add and edit, but I ...
0
votes
0
answers
92
views
Using run_login() on a P4 instance inside Docker container updates the tickets file but does not update the value of the password on the instance
For some reason, when I use the run_login() method on a connected P4 instance inside of the Docker container, it correctly updates the ticket file, but the value stored on the instance does not get ...
1
vote
0
answers
348
views
P4Python Exception: Parameter –ssl is needed
I’m trying to install P4python library into the latest Anaconda 2023.09-0 version (python 3.11.5). I’m getting following issue:
pip install p4python
Collecting p4python
Using cached p4python-2023.1....
1
vote
1
answer
190
views
Run P4Python in AWS Lambda
I am writing an application that retrieves the changelist from Perforce, and lists all the files that have been changed.
I want to deploy this on AWS Lambda, but whenever it runs, I get the following ...
0
votes
2
answers
559
views
P4python how do I mark a list of files for add/edit?
I have a TON of files (~260,000) sorted into files with lists of files by type. (binary, binary+Dx, text, text+x, etc...)
EI -
binary:
D:/Workspace/folder1/file.dll
D:/Workspace/folder2/file.res
D:/...
1
vote
1
answer
356
views
Perforce P4Python create new stream without vim opening
I am trying to create and populate streams from a parent using P4Python.
using the .run command I can send the terminal command, but I cannot surpress vim opening, which prevents the script from ...
0
votes
1
answer
93
views
How to call .cpp function inside p4python script?
My job: I want to create a python script that changes the content of a file automatically and then commit the change in Perforce.
Because the file at first is read-only. So I need to create a python ...
0
votes
1
answer
265
views
How to install p4python on Cygwin64
Trying to install p4python on Cygwin fails with
$pip install p4python
[... logs ...]
File "/tmp/pip-install-6mn3hyn3/p4python_9e95a104710b449a90a68bc227a2ee69/setup.py", line 292, ...
1
vote
1
answer
113
views
P4Python create label without tmp file from getting opened
I have a requirement to create multiple perforce labels from my test script. Following snippet creates a perforce label. But it happens to open a .tmp file for me to edit the description and the ...
0
votes
1
answer
459
views
P4Python cannot use progress class
I don’t know why this will raise AttributeError, but in document it seems right https://www.perforce.com/manuals/p4python/Content/P4Python/python.p4_progress.html
from P4 import P4, P4Exception, ...
0
votes
0
answers
130
views
P4Python - getting affected files given changelist number
so far I have been using p4.run("files", "@=" + ) to find the affected files per CL. However, I'm having the issue that for certain CLs the output shows 'no files found'. When I ...
0
votes
0
answers
24
views
Trying to Migrate P4V data to git using P4Python [duplicate]
Here I am trying to migrate my perforce data. The code is below:
from P4 import P4, P4Exception
p4 = P4()
p4.port = "localhost:1666"
p4.user = "xyz"
p4.client = "xyz"
p4....
0
votes
1
answer
160
views
p4python check if any actions are being run
I have a threaded timer running to disconnect from p4 after a certain amount of time (because perforce will auto timeout in our application and fails to reconnect). I want to make sure that I do not ...
0
votes
1
answer
53
views
Tkinter Messagebox doesn´t appear when called in perforce trigger script
I am writing a script in Python 3.8.7 using the P4Python interface for our Perforce server.
There are some circumstances where I don´t want to abort the submit of changes, but I need to inform the ...
-2
votes
1
answer
520
views
how to check file is opened from python scrip
I need to check file is opened in perforce or not like this:
if((p4.run("opened", self.file) != True):
but it's not the right way I think it's always true
can you please help to solve this
...
0
votes
1
answer
557
views
How to get all the mainline streams of a project in Perforce
I need to get all the mainline streams of a project. I tried this in the terminal
p4 streams -F "Type=mainline" //someproject
and got the following error,
//ConMod - must refer to client '...
0
votes
1
answer
636
views
P4Python trouble deleting client/Workspace
I am trying to delete a client but I get the following error :
"Identifiers too long. Must not be longer than 1024 bytes of UTF-8."
My code goes smth like this:
try:
client=p4....
1
vote
0
answers
934
views
Perforce command timeout doesn't seem to work
I am trying to set timeout to the perforce commands using the net.maxwait configurable as per this document:
https://community.perforce.com/s/article/3751
user@test:~/perforce/sandbox$ date; p4 -v net....
0
votes
1
answer
1k
views
How can I download/sync file in P4V/p4python locally?
I am trying to download/sync locally into my Perforce workspace a file from another stream of my P4V, I've tried p4.run_sync("-f", "//depot-of-file") in my python script but it ...
0
votes
1
answer
160
views
p4python windows x64 build link errors
I've been trying to build p4python on 64 bit for windows, but I am getting the following link errors:
Creating library build\temp.win-amd64-2.7\Release\P4API.lib and object build\temp.win-amd64-2.7\...
0
votes
1
answer
215
views
using p4python module create a patch between two changelist
I am trying to create a patch between two changelist using p4python.
I am not getting any success. Below is my attempt:
$ vi patchp4.py
from P4 import P4,P4Exception
p4 = p4()
#Performed P4 Connection
...
1
vote
2
answers
2k
views
How to open a checked out file P4 Python
I am currently writing a script in Python with the P4Python API which automates the process of checking out a file in Perforce and making some changes to it. I'm currently trying to figure out how to ...
0
votes
1
answer
46
views
Sending json collections to Perforce depot
I am trying to send json collections from a Flask server to remote Perforce depot using P4Python.
Is there a way to do that through Python?
0
votes
1
answer
2k
views
In P4, how do i check if a change submitted to one branch is also submitted to another branch using command
I want to find out there is a p4 command that can find cl submitted in a depot branch from a cl submitted in another depot branch.
like -
if CL 123 was submitted to branch //code/v1.0/files/...
and ...
1
vote
1
answer
301
views
P4Python: AttributeError: type object 'P4' has no attribute 'MergeData'
I am trying to create a P4.MergeData object to use with a resolver. I get this error (in title) when I do:
import P4
md = P4.MergeData()
How do I create this object? Or if I don't need to, how do I ...
0
votes
1
answer
935
views
How can I checkout a file from a changelist on perforce server using Perforce Python API's (p4python)
Originally I am trying to implement a customized python based linter to help me out with the lexical code analysis. This linter requires me to point to the directory where the scripts or code files (...
0
votes
1
answer
4k
views
No files to submit even after I add them to perforce changlist
I get a changelist number and I am able to add the files to the changelist
>>> createdCLNumber
'1157545'
>>> p4.run_add("-c", createdCLNumber, "/Users/ciasto/ciasto_piekarz/sandbox/...
0
votes
1
answer
786
views
when I try to add files to the changelist I keep getting error files not in files(s) not in client view
When I am trying to add files from the command line I get the error saying files not in client view what does it mean ?
createdCLNumber = p4.save_change(changeList)[0].split()[1]
>>> ...
1
vote
2
answers
2k
views
How to get the changelist number of perforce?
I managed to create an empty changelist in my perforce client workspace following the steps below :
>>> from P4 import P4,P4Exception
>>> p4 = P4()
>>> p4.connect()
P4 [...
1
vote
1
answer
332
views
Copy comman in p4python with Perforce
For branching I from a certain CL and have it as a changelist I realized that Perforce uses the copy keyword. I'm tryin to use the same keyword but getting an error saying that the options are invalid....
0
votes
1
answer
281
views
Undoing changelist in P4Python
I have an issue with undoing changes in Perforce using p4python given that I have sumitted the changelist that I now want to undo.
My idea is first to create a changelist and then run the undo. ...
1
vote
1
answer
548
views
branching when ther has been a a branch with the same name that doesn't exist anymore p4python
While testing my application using p4python I came across an intressting issue. I branch a while ago from a main stream directory to a testing directory, I did a revert on that branching since ...
1
vote
1
answer
91
views
Adding description when branchen in Perforce using P4python
I already figured out how to branch and submit my changes however since I use a project management platform like Jira I also need to write a description on each check ins.
This is my code for ...
1
vote
1
answer
849
views
Extract branch name from p4 depot path
Is there any perforce command or p4 util available to extract the branch name out of depot path.
For ex I have depot location as "//depot/folder/suffix" and the branch name as "b-folder-suffix".
How ...
1
vote
0
answers
480
views
P4python needs to check what files are changed in a specific changelist
Using python and p4python I'm trying to shows the files that are changed in a changelist. I
result = p4.run_describe("2631893", tagged = 0)
This shows the files in a change list and not what is
...
0
votes
2
answers
2k
views
P4Python does not check out the file in Perforce
I have following piece of code. I'm trying to check out two files from Perforce and put them in a changelist. But run_add does not check the files out. The only thing I see in Perforce is a empty ...
0
votes
0
answers
1k
views
Using P4Python, how can I use environment variables to access different clients across different computers/workspaces?
I'm working with Perforce and have a script to check out various files depending on my current task. The issue is that I'd like to store environment variables for the port, user and client so that I ...
0
votes
3
answers
3k
views
How do I install p4python on macOS 10.15 Catalina?
I get an error when trying to install p4python on macOS 10.15 Catalina.
Command pip install p4python.
Cannot build P4Python without SSL support
Exception: Parameter –ssl is needed
When I try to ...
1
vote
1
answer
3k
views
p4python create and submit a new file
How to create and submit a new file using p4python?
create_and_submit_file(full_path_in_depot, new_file_text_content):
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
p4 = get_p4() ...
0
votes
0
answers
178
views
How to set config variables using p4python
I have tried doing below:
p4.run('configure', 'set', 'auth.ldap.timeout=30')
However, when I try below, I dont see this configuration set.
p4.run('configure', 'show')
Please let me know if i am ...
1
vote
1
answer
300
views
P4Python issue: p4run("files", 'path') returns - no such file(s) although returns single item dict for "dirs"
I'm trying to read depot structure without syncing and got stuck on files listing.
Why this returns single-item dict:
p4.run("dirs", '//folder1/Trunk/projects')
but this:
p4.run("files", '//...
2
votes
1
answer
441
views
P4Python : AttributeError: type object 'P4' has no attribute 'Map'
Here is the code I use:
from P4 import P4, P4Exception
mp = P4.Map()
And here's the error I get:
mp = P4.Map() AttributeError: type object 'P4' has no attribute 'Map'
WHY?
According to P4Python ...
2
votes
1
answer
422
views
P4Python installation via pipenv fails inside docker file
The pipenv's file has the module p4python specified for installation and below is the relevant line in the docker file which runs the pipenv's module installation.
RUN pipenv install --system --...
0
votes
1
answer
2k
views
How to fix P4 client errors after integrating p4python in code?
I have aligned my client perforce and view perforce with all the files and links. Though, while connected through my p4python code base, then it's not able to get/ fetch the updated paths in the view. ...
3
votes
3
answers
4k
views
ImportError: /usr/local/lib/python3.7/site-packages/P4API.cpython-37m-x86_64-linux-gnu.so: undefined symbol: SSL_library_init
**
*File "/usr/local/lib/python3.7/site-packages/P4.py", line 410, in <module>
import P4API
ImportError: /usr/local/lib/python3.7/site-packages/P4API.cpython-37m-x86_64-linux-gnu.so: ...
5
votes
2
answers
7k
views
Cannot build P4Python without SSL support win 10
trying to install p4python on Windows 10 with cmd:
pip install p4python
and getting
Using cached
https://files.pythonhosted.org/packages/36/5a/...
1
vote
3
answers
1k
views
P4Python check if file is modified after check-out
I need to check-in the file which is in client workspace. Before check-in i need to verify if the file has been changed. Please tell me how to check this.
0
votes
0
answers
3k
views
P4Python Adding new file - [Error]: Null directory (//) not allowed in //workspaceXXXX//xxxx.txt
I am trying to add new to perforce. I getting error as below
[Error]: "Null directory (//) not allowed in '//workspaceXXXX//xxxx.txt'."
What i am doing:
1) I create a workspace
self.p4.client = "...