Book a Demo

Author Topic: Python script to copy a repository (.eapx file) fully  (Read 4108 times)

ArshiaZare

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Python script to copy a repository (.eapx file) fully
« on: June 13, 2023, 06:33:55 pm »
Hey guys,
can anyone help me with how I can make a copy of the entire repository/eapx file to clipboard?

thank you

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Python script to copy a repository (.eapx file) fully
« Reply #1 on: June 13, 2023, 06:55:41 pm »
Can you explain what you want to achieve?

Why would you want to copy the .eapx file tot he clipboard?
There might be better solutions that avoid using the clipboard alltogether.

Geert

ArshiaZare

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Python script to copy a repository (.eapx file) fully
« Reply #2 on: June 13, 2023, 07:12:05 pm »
Can you explain what you want to achieve?

Why would you want to copy the .eapx file tot he clipboard?
There might be better solutions that avoid using the clipboard alltogether.

Geert

so basicaly, our model is stored on a server and due to organizational reasons its taking and will take so long for us to have access to the server as a mod, we want to have safe copies of the file in order to have a very premitive version control for now so we can continue our work, however from what i have seen with EA's version control scripts, they all operate within the repository, so I wanted to know if there is a way to copy/paste the entire file.

if there are better ways please let me know since I'm very new to this im winging it 90% of the times :')

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Python script to copy a repository (.eapx file) fully
« Reply #3 on: June 13, 2023, 07:44:53 pm »
If all you want is to make a copy of the file to another location, you don't need to use the clipboard.

See https://stackoverflow.com/questions/123198/how-to-copy-files

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Python script to copy a repository (.eapx file) fully
« Reply #4 on: June 13, 2023, 08:08:21 pm »
Well, if you make copies, then how will you merge the local changes made in the distributed files?

q.

ArshiaZare

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Python script to copy a repository (.eapx file) fully
« Reply #5 on: June 13, 2023, 08:11:01 pm »
Well, if you make copies, then how will you merge the local changes made in the distributed files?

q.

to be fair, this si not at all a long term solution, but rather a temp snapshot solution to make sure we dont lose our model.

ea0522

  • EA User
  • **
  • Posts: 134
  • Karma: +5/-0
    • View Profile
Re: Python script to copy a repository (.eapx file) fully
« Reply #6 on: June 13, 2023, 08:13:31 pm »
If it is indeed a manual action, why not use the option to transfer a model?
See: https://sparxsystems.com/enterprise_architect_user_guide/16.1/model_exchange/performadatatransfer.html

ArshiaZare

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Python script to copy a repository (.eapx file) fully
« Reply #7 on: June 13, 2023, 08:48:17 pm »
If all you want is to make a copy of the file to another location, you don't need to use the clipboard.


Geert
thank you for your response, Is there a way to export a package as xml using scripting?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Python script to copy a repository (.eapx file) fully
« Reply #8 on: June 13, 2023, 09:20:54 pm »
Yes, Project Interface.ExportPackageXMI()

Geert