Comments (19)
Hi, what version of Python are you using. Seems to be that something in the shutil
module changed.
Can you provide following output:
python --version
python -m pip freeze
from simple-photo-gallery-bulkcreation.
Version is Python 3.7.2
from simple-photo-gallery-bulkcreation.
and which OS are u using? If it's Windows, I've never tested it there :/
from simple-photo-gallery-bulkcreation.
ok, it is not the OS. Just checked, the the option dirs_exist_ok
of shutil.copytree
was introduced in Python 3.8.
Thus this whole package currently just supports Python version 3.8 or higher. Sorry that this was not highlighted anywhere.
Are you able to use a newer Python version?
I will also backport this package to older versions as far as I have some time.
from simple-photo-gallery-bulkcreation.
Yes, I use Windows. Thanks for the info.
from simple-photo-gallery-bulkcreation.
Hi @tyeeman,
I just released a new version 0.2.0 (https://pypi.org/project/simple-photo-gallery-bulkcreation/) which should also support your Python version 3.7.
Please check and feedback. Afterwards I will close this issue.
from simple-photo-gallery-bulkcreation.
ok, thanks. I'm not sure if I have to run "gallery-init" first or just run "gallery-bulkcreation" first? And what about "gallery-build". Please specify the order of the 3 commands.
Update - Yes, it works fine, thanks a lot! The sort order is alphabetical I believe because I have incrementing number at the beginning of each filename and it sorts in order.
Question - How to change the number of images per row in the main gallery page? I've added 3 galleries and have only 2 images per row. I would like 3 or 4. Also where is the main page template? I want to add some menu items to it. It would be nice to have these menu items show up on all pages.
Update for anyone else - You don't have to run "gallery-init" or "gallery-build". Just make the "config.ini" and then run "gallery-bulkcreation" and it works.
from simple-photo-gallery-bulkcreation.
You just have to prepare the config file (an example you can find here: https://github.com/hille721/simple-photo-gallery-bulkcreation/blob/master/example/config-example.ini) and then run the gallery-bulkcreation
command.
No need to run gallery-init
or gallery-build
, they are in gallery-bulkcreation
included. In fact, you can't use those commands together, you would break things.
from simple-photo-gallery-bulkcreation.
Question - How to change the number of images per row in the main gallery page? I've added 3 galleries and have only 2 images per row. I would like 3 or 4.
Could you send a screenshot? Normally this should be adjusted automatically, dependent on your screen size.
Also where is the main page template? I want to add some menu items to it. It would be nice to have these menu items show up on all page
https://github.com/hille721/simple-photo-gallery-bulkcreation/blob/master/src/simplegallery_bulkcreation/data/templates/index_template.jinja
This is the template for the overview page. For the single galleries the template is coming directly from the simplegallery package.
from simple-photo-gallery-bulkcreation.
I don't seem to have that template for the overview page even though the gallery built somehow.
My bulkcreation folder only has "config.ini" and my "gallery" folder. In that "gallery" folder I have my 3 gallery folders (containing photos) plus a "gallery_data" folder with it containing a "templates" folder and "images_data.json" and "gallery.json".
So I wonder where the "index_template.jinja" is for the overview page?
Here is my overview page showing 2 galleries per row - I have my PC set up for text to display at 150% of normal. Would that have anything to do with it?
from simple-photo-gallery-bulkcreation.
There are two possibilities, the easiest would be to directly change the index.html files after the creation and not the templates before. The index.html
files are located under gallery/public
, e.g. :
└── public
├── 2017-11-01_15-20-23.jpg
├── Greece_2019
│ ├── css
│ ├── images
│ ├── index.html
│ └── js
├── Mexico_2019
│ ├── css
│ ├── images
│ ├── index.html
│ └── js
├── Oman_2020
│ ├── css
│ ├── images
│ ├── index.html
│ └── js
├── css
│ ├── default-skin.css
│ └── main.css
└── index.html
You can see, there is a index.html
directly under gallery/public
which is the index file for the overview page, and then there are index files belox each gallery.
But be careful, if you run the gallery-bulkcreation
command again, changes in those files will be overwritten again
The other possibility is to change the templates. For that you have to find out, where pip installed the packages, e.g. via the pip show
command:
$ pip show simple-photo-gallery-bulkcreation
Name: simple-photo-gallery-bulkcreation
Version: 0.2.0
Summary: Plugin for the simple-photo-gallery to provide a config based bulk creation
Home-page: https://github.com/hille721/simple-photo-gallery-bulkcreation/
Author: Christoph Hille
Author-email: [email protected]
License: MIT License
Location: /home/hille/test/.venv/lib/python3.9/site-packages
Requires: Jinja2, simple-photo-gallery
Required-by:
In the location line you can see, where the package is installed. From there you will find the templates under simplegallery_bulkcreation/data/templates/
for the overview page and simplegallery/data/templates/
for each gallery.
The advantage of this method is, that the changes are persistent and you can run the gallery-bulkcreation
again and again. Also if you add new galleries, they will directly have the correct layout.
from simple-photo-gallery-bulkcreation.
Here is my overview page showing 2 galleries per row - I have my PC set up for text to display at 150% of normal. Would that have anything to do with it?
If I have three galleries it is looking as this with a wide screen:
But on a smaller screen there are just two galleries per row, or on my smartphone just one. This is really dynamic and optimized for the screen size.
Thus yes, in your case it is probably because of the 150% , you set up for text to display.
from simple-photo-gallery-bulkcreation.
Can you have your code copy the overview page template and individual gallery page template from the php area to the root folder of the gallery when gallery-bulkcreation
is run and use them from there instead to build the galleries? That would solve it easily, then everything is in one place.
My location is Location: c:\python37\lib\site-packages
. So when gallery-bulkcreation
is run copy them to my gallery root.
from simple-photo-gallery-bulkcreation.
Then you would also have the problem that rerunning the command will overwrite everything again.
from simple-photo-gallery-bulkcreation.
Running the command the first time or any other time - the first time copy the templates to the root and build from there. All builds can use these root templates. When building just check first to see if they are already there, if yes, build using them, if they are not there (only the first time) then copy then build using them.
Oh yeah, but then how does the original app do it. I added menu items there and it works well. Let me check where the original app stores the templates.
Ok, the templates for the main page are in a templates
folder in my root gallery folder. index_template.jinja
is there along with gallery_macros.jinja
. There are also 2 other files in my root gallery folder, images_data.json
and gallery.json
.
from simple-photo-gallery-bulkcreation.
Yes in Simplegallery you have those two steps, init and build. After the first init you can change the templates and run the build command again and again.
In this bulkcreation command you run always both steps, thus the templates will be copied every time. There I was kind of lazy when I've implemented it. 😃
I will check what I can do that it works as you expects.
from simple-photo-gallery-bulkcreation.
I edited my post two posts up, please re-read about checking the templates for existing every time a build is run.
from simple-photo-gallery-bulkcreation.
Ok, the templates for the main page are in a templates folder in my root gallery folder. index_template.jinja is there along with gallery_macros.jinja. There are also 2 other files in my root gallery folder, images_data.json and gallery.json.
You have this with bulkcreation as well. But there the templates will be overwritten if you run the command again.
But as I said, I will think about a solution, how to solve this 😉
from simple-photo-gallery-bulkcreation.
I've created #6 to track this enancement.
from simple-photo-gallery-bulkcreation.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-photo-gallery-bulkcreation.