Recent Posts

Pages: 1 2 3 [4] 5 6 7 8 9 10
31
Scripts and Plugins / Re: Change the height of the document
« Last post by digirew on September 21, 2020, 05:19:15 pm »
Hi Nermander,

re: "Sounds like a very strange requirement, in most cases page size is dependent on what you are going to print on".


Most of the scribus pages being worked on are not the "final" pages used for print. A PDF is generated from these pages and then used by another user who is working on the layout of the final page. (in a basic example I can think of; think of graphics/photos in a magazine, one single user is not building the entire complete page. different people work on different areas of a page and then its all put together by someone with text flowing around).


For now im using copy/paste functions in a script which seems to do the trick. In InDesign we found it was much more efficient to resize a page vs trying to keep track of all the object on a page and copy them over etc.
32
Scripts and Plugins / Re: Ability to have own menu with scripts?
« Last post by a.l.e on September 21, 2020, 05:18:09 pm »
i've digged further in the recent past of my research and here are a few links:

Using Virtualenv without bin/python
https://virtualenv.pypa.io/en/legacy/userguide.html#using-virtualenv-without-bin-python

Make it easier to use a venv with an embedded Python interpreter
https://bugs.python.org/issue35706

Make pyvenv style virtual environments easier to configure when embedding Python
https://bugs.python.org/issue22213

not an easy read and my conclusion is that there are currently no way to get it to work on all three main target platforms.
33
Scripts and Plugins / Re: Ability to have own menu with scripts?
« Last post by a.l.e on September 21, 2020, 05:03:20 pm »
why the usage of venv / virtualenv?

then you can set up an environment and get scribus to point to it and cleanly access all libraries it needs for running the scripts.

you can add a requirements.txt to your script and anybody who gets them can run your script without having to perform special tricks.

that should work in a similar way as in most python IDEs, where you can (create or) pick a venv.

(iirc) right now -- at least on linux -- you can achieve the same effect by starting scribus from terminal with an activated venv.
that's really cool, but i can't expect the users of my scripts to do the same.



and as i've already had the chance to write in the past, i don't like the idea of messing around with the xml in the .sla files. there are a few reasons for that.
in short: directly editing a .sla is ok to solve a specific sudden problem. but i would not build a long term business on top of it.
(mainly: you get a fragile solution and since your solution is not general or even portable, it does not improve the scribus ecosystem)
(on top of it: several have tried in the past and the scribus generator is the only effort that somehow succeeded; still, i think i've demonstrated that it's possible to implement it in scribus itself and -- at the same time -- make scribus a better place; it makes me a bit sad to see how much work that has been put into the generator... but the scribus project is also at fault there.)
34
thanks for confirming the issue is in 1.5.5 and not setup related to my machines (I am running 1.5.5).

Are you able to comment how stable 1.5.6 is in comparison to 1.5.5?

Im searching the scribus site, I cant seem to find the downloads for 1.5.6.


35
Scripts and Plugins / Re: Ability to have own menu with scripts?
« Last post by dragonfly on September 21, 2020, 03:21:02 pm »
Quote
i think that it would be preferable to get scribus or its scripts to recognize venvs / virtual environments.

.. but why? Can you explain the reasoning?

Meanwhile, as another "outlier" idea, I am focussing on using PHP for server side scripting. Some rough experiments allow custom Scribus documents to be parsed either in localhost or remote PHP server.
The principle of using variables (as in ScribusGenerator) is followed by embedding PHP variables in Scribus templates but large chunks of content can then be merged into Scribus template and "compiled" *.sla downloaded to be run in desktop Scribus.
36
Scripts and Plugins / Re: Ability to have own menu with scripts?
« Last post by a.l.e on September 21, 2020, 01:24:44 pm »
i think that it would be preferable to get scribus or its scripts to recognize venvs / virtual environments.

i had a short look at it last week but i could not find a good solution.
but i stumbled on a longer ticket / bug report that made me think that venv cannot be used yet in a scripting context.
but it should be possible with virtualenv.

does anybody have any further insight?

ciao
a.l.e

p.s: of course, if i recall correctly it's trivial to start scribus from inside of a venv... but the idea would be that one can define from inside of scribus which venv to use... in the ideal case, it's a per script "configuration".
37
General Discussion / Re: opening up a scribus .sla file does not open the document itself?
« Last post by utnik on September 19, 2020, 06:59:39 pm »
hi digirew

I believe it's a bug on the Mac side. Im running MacOS Mojave 10.14.6. I also tried this on another 10.14.6 machine and got the same results.

i'm on macOS 10.14.6 as well, but here a double click on a .sla file opens scribus and the file. but there was a time when i had the same issue.
a quick test (right click and 'open with') shows:
  • version 1.4.8 → scribus launches and opens the file.
  • version 1.5.5 → scribus launches with an empty window.
  • version 1.5.6 (r24014) → scribus launches and opens the file.
if you're working with scribus 1.5.5, you have the choice between an update or living with two more steps…

utnik
38
I use XMLCopyEditor to inspect the inner code of Scribus *.sla but I am on Ubuntu.

For Mac you will need to use an alternative XML editor.

39
General Discussion / Re: Save document preferences like zoom levels?
« Last post by dragonfly on September 19, 2020, 05:38:27 pm »
Quote
However, we have many users that might open/edit hundreds of documents per day. Doing this each time is a lot of extra steps. Most of these file are very small and need 300-400% magnify by default.

That is a tall order.
First thought is to use an automation script (like a macro) but this becomes difficult in a cross platform scenario (across Linux, Windows, Mac).
One approach I am using for another application is to parse the document code before running.
Likewise Scribus *.sla can be parsed as XML and attributes therein edited.
In fact if you look at ScribusGenerator.py in Scripter you should be able to add a variable in document attribute and run that script to change document height variable in a batch run controlled by a csv file.
40
Scripts and Plugins / Re: Ability to have own menu with scripts?
« Last post by dragonfly on September 19, 2020, 05:27:20 pm »
A thought about a workaround.
Not exactly in an integrated menu .. but .. I would include in the core scripts a simple script which open a custom dialogue to allow choosing external python modules to be imported into Scripter.  The external folder containing custom scripts has to be on sys.path.

One reference to using external modules found here.
https://bic-berkeley.github.io/psych-214-fall-2016/sys_path.html

Pages: 1 2 3 [4] 5 6 7 8 9 10