Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Working Copy integration sidebar
-
@smath I just submitted a pull request to your repo, just a couple of small changes. When I push/upload, the operation works, but when it switches back to Pythonista, a notification pops up saying that I have no such file in my library.
-
I have forked the wc_sync repo and made some updates to it to work with the Pythonista 2.0 beta. The sidebar view has not worked in the beta for a while now and some other changes have been made that made the original code unusable.
PS @Utsira - Working copy sends back the name of the updated file in the x-callback-url, so in turn Pythonista tries to open said file, which it thinks is in the root directory, since WC does not send back the repo name. I have accounted for this in my updates below.
-
@ahenry91 slight issue with the UI it doesn't appear to be responsive on my iPhone it is cut off slightly still usable though.
If you are happy to accept a pull request I might try and fix it tonight if someone doesn't beat me to it. -
@shaun-h sorry, I beat you to the iPhone interface. If you would like to create a better interface, I'd be happy to accept the pull request.
-
Were the ideas in these two pull requests incorporated into the current code? https://github.com/pysmath/wc_sync/pulls
-
@ccc it looks like the
open in current repository
pull request is incorporated in my fork, but not the other one (INSTALL PATH
). I haven't made a pull request for my fork back to the original repo. -
So, I have made some changes to the Working Copy Integration project.
Changes:
- Rewrote the main script to use a class structure allowing easier extension of the project.
- Moved the URL Scheme code (rxZip.py and rxFile.py) into the class.
- Retrieve a list of available repos from Working Copy when copying a repo into Pythonista. You don't have to type the name of the repo anymore.
- Moved from the UI module to the Dialogs module for the interface. This makes it easier to be sure that the UI works across all devices.
- Integrated one of the Pull Requests for the original repo to determine the Install Path automatically.
I think that is all the changes for now. I am looking into a way to push all changed files in the repo to Working Copy, but haven't quite figured out how to approach it. If anyone wants to tackle it, be my guest.
Note: Sometimes Working Copy hangs for a few seconds when retrieving the list of available repos. Give it a few seconds and it will return to Pythonista.
-
hangs for a few seconds...
A
console.hud_alert()
can help the user experience a lot in these situations. -
When I try running Working_Copy_Sync.py, l am getting an error on line:
import dialogs
Are "dialogs" a beta 1.6 things only?
-
@mrcoxall I think you're right that dialogs is a beta feature. Hadn't realized that when I did the rewrite. The release version is under review (again) for the App Store and will hopefully be out soon.
-
http://appreviewtimes.com/ current review time: 14 days!
-
I have upgraded to Pythonista 2.0 to give the Working_Copy_Sync.py a try. I have pasted in the code into a script called Working_Copy_Sync.py, but I am getting acerror on line:
repo, path = fullPath.split('/', 1)
-
@mrcoxall try moving the script to a sub directory such as wc_sync.
-
Or put
print(fullPath)
on the line before the problematic line and tell us what gets printed to the console. It is also very helpful to know exactly what the error message is. -
@ccc the error is caused by the script being in the root (home) directory. So the full path doesn't have a
\
, just the script name. When you split it (line 47), you only get one return value and the script tries to unpack it into repo, path.The script uses the project directory as the repo name. I'm looking into a possible solution for this.
-
Moving it to a subdirectory called wc_sync worked.
Thanks.I get the dialog showing up.
The problem is when I try doing a "Push", I get an error in Working Copy. The error says:No repository found where name or remote-URLs matches repo=wc_sync.
-
@mrcoxall Sorry for the (really) delayed response here. You need to create a repo in Working Copy called wc_sync so that it will have somewhere to push the changes. For other repos, you need to add the Working_Copy_Sync.py script to the quick actions in Pythonista.
-
I have updated the Working Copy Sync script again with a couple of changes.
Before updating to the latest version, push all of your changes from Pythonista to Working Copy. After updating, you will need to clone each of your repositories again, overwriting any changes not pushed to Working Copy.
- Repo information is now stored in a .wcsync file in the repo root directory and doesn't use the currently directory to determine the repo-name. This means that you can rename a folder or move it to a different location (out of the documents dir) and you can still use Working Copy with the repo.
(You can also move the Working_Copy_Sync.py script to the root directory if you like, but I recommend leaving it in its own directory in order to pull changes from the repo in Working Copy.) - If you run the script (from the action menu) in a folder without a .wcsync file, it will only show the option to clone a new repo from Working Copy. In folders containing a .wcsync file, it will provide the regular fetch, push, etc. options.
Note: The script searches for the .wcsync file recursively (up the folder tree). So you can still have folders within your repo and it should all work. Also, there is an issue with spaces in folder/file names when using URL schemes between Working Copy and Pythonista, so I would avoid spaces.
Link for completeness: https://github.com/ahenry91/wc_sync
- Repo information is now stored in a .wcsync file in the repo root directory and doesn't use the currently directory to determine the repo-name. This means that you can rename a folder or move it to a different location (out of the documents dir) and you can still use Working Copy with the repo.
-
Is there a way to create a new directory in Pythonista add some *.py files and then move the entire directory over to Working Copy as a repo?
At the moment it seems like you need to create a repo in Working Copy, add a "place holder" file, move to Pythonista and clone the repo in and then add your *.py files.
Looking for a way to start in Pythonista and the move to Working Copy.
Thanks
-
@mrcoxall
stash
has very good git support. I'd use that to push to remote, then open in working copy from there. There's no real reason to use working copy, though, if you're comfortable with command-line git.