ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been trying to modify a config file in a program written in Python2 (Trelby).
A friend tried the modification on a virtual machine and it worked.
But, when I try it on the installed system, the program always loads the version of the file cached by Python.
So, the question is, how do I clear the python cache?
usually python compiles the code and there will be a *.pyc file next to *.py. So if you modified a python source file probably you only need to remove the related *.pyc (although python handles it automatically).
If it was something else I think we have no idea what kind of cache are you talking about (I'm not really sure if it was really cache related issue).
There is no such thing "the python cache".
Would be nice to give more detailed info.
Pan 64,
first off, thanks for the answer
I know nothing about python (you might have guessed that already).
The program in question is a WP called trelby.
My issue is changing the default position of the find/replace window.
I modified the file finddlg.py and a friend tested the code on a virtual machine and it worked.
When I made the same change in the installed program, it keeps setting the window the same way, no matter what I do.
I tried the following (all with the same result as above):
a-erase the old finddlg.py file and replace with the modified one.
b-recompile trelby after modifying the original sources in Debian and reinstalling it from scratch.
c-recompile trelby after modifying the original sources in Arch and reinstalling it from scratch.
d-as "c" but on a live CD.
e-as "c" but on a new install which downloaded python from newly as a dependency.
f-replace the finddlg.py with the modified one REMOVE finddlg.pyc.
My guess is that the original configuration is stored somewhere in the Trelby code that bypass the finddlg.py instructions.
My question is where that happens or how to find out.
yes, that makes much more sense. Usually it is located in users' home dir, need to look for something like .trelby .config (or something similar). You need to cd into that directory and you will see the stored configuration.
Also you might find this useful: https://www.trelby.org/assets/manual.html#settings
That's one of the first things I've done, but the home dir trelby config file deals with the text format and other stuff. No mention of window positioning.
Therefore, the suggested link, which deals with the possibility of using a different config file from .trelby, would not be any help.
in that case unfortunately I have no better idea than:
1. analyze the python code to find out how does it work.
2. use strace or similar to find the files accessed.
3. ask the developers.
4. you may try to use another linux user.
Yes, it's kind of baffling.
I tried to contact the developers but got no answer (trelby is a great app but not aggressively maintained).
Using another linux user doesn't help, it's something system-wide.
as for 1 & 2, they are above my level of knowledge.
Using another linux user doesn't help, it's something system-wide.
But this information may help. In such cases the config files should be common, not stored in users' home. Probably in /etc, in /etc/trelby, or somewhere under /usr/local. It looks like trelby is installed into /opt/trelby, you may need to check that too.
In the documentation, chapter 8 you can find the following:
Code:
Trelby supports the following command line parameters:
--conf FILENAME
Read global settings from the given file instead of "default.conf".
I solved this, at least.
the only common denomnator was the theme I used, which missed the applets.
Drove me crazy for days but finally found the culprit, LOL.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.