Fileconveyor Installation - python

With Fileconveyor limited documentation I'm confused as to where it installs after I've run the pip command as follows on their website Fileconveyor.org.
Bottom line: Anyone have luck installing Fileconveyor on Debian 6 for integration with Drupal 6 and the CND Module?
I can't figure out where to put my settings.xml file.
Thanks,
Curtis

The documentation does give indication of where things are put, but it isn't entirely clear in that we expect an "installation" to move things to certain destinations, such as /usr/bin. In reality, Fileconveyor is installed in the very same directory as wherever the git clone placed it.
The settings file (which must be cp from a file named "config.sample.xml") is in a folder 'conveyor' within the main 'conveyor' folder.
The link where you can read about this is https://github.com/wimleers/fileconveyor
It reads in part: "The sample configuration file (config.sample.xml) should be self explanatory. Copy this file to config.xml, which is the file File Conveyor will look for,
and edit it to suit your needs."
Starting it doesn't actually invoke any command with the name 'fileconveyor', which I previously mentioned is what one might expect from a typical installation. Another instruction from the above link reads:
"Starting File Conveyor
File Conveyor must be started by starting its arbitrator (which links
everything together; it controls the file system monitor, the processor
chains, the transporters and so on). You can start the arbitrator like this:
python /path/to/fileconveyor/arbitrator.py"
In my case the command is 'python ~/src/conveyor/conveyor/arbitrator.py'
In retrospect I might reinstall in another directory in case I ever empty my ~/src folder which is the folder I use to initially download items to compile and install, then clean. I wasn't expecting it to end up being the installation folder for Fileconveyor.
Hope this helps.

Related

Safe to change python file during run time?

I have python 3 file that run a SVN deployment. Basically run "python3 deploy.py update" and following things happen:
Close site
Backup Ignore but secure files
SVN revert -R .
SVN update
Trigger tasks
Open site
That all sounds simple and logical, but for one thought going around my head "SVN is writing files, including python files and sub module helpers that are trigger the SVN subprocess"
I understand that python files are read and processed and only through some tricky reload will python reload. And I understand if SVN change python source then update would only take effect on next run.
But question is "should keep this structure or move file to root and run SVN to be safe side"
Applies to GIT or any python changes
From what I know it is safe to change python (i.e. .py) file while python is running, after .pyc file has been created by python (i.e. your situation). You can even remove .py file and run .pyc just fine.
On the other hand SVN revert -R . is dangerous here as it would attempt removing .pyc files, so either screw up your python or fail by itself.

File exist but console says it does not exist

I have a project which it's structure it's based on the pitftmenu.
I have created mine and by calling each py file separately everything looks to work smoothly.
If you notice on the pitftmenu there is a menu file which kind of links each py file (menu) together and you can switch to one another.
I have created mine according to my needs but when I call sudo ./menu on the console, the console says it does not exist.
It used to work but, I was experimenting with something else on my raspberry Pi, and I had to reinstall rasbian. I moved back my files and installed "all the packages" I needed. My only issue is that and I dont know why.
It is worth to be mentioned that if I run the menu file on the pitftmenu folder it is working. Any ideas?
As spectras said - It's not executable. If it should be, mark it as such with chmod a+x menu
Credits to spectras for the solution

create an application in excel using python for a user without python

I am doing an application in Excel and I'd like to use python language. I've seen a pretty cool library called xlwings, but to run it a user need to have python installed.
Is there any possibility to prepare this kind of application that will be launch from a PC without Python?
Any suggestion are welcome!
A small workaround could be to package your application with cx_freeze or pyinstaller. Then it can run on a machine without installing python. The downside is of course that the program tend to be a bit bulky in size.
no. you must need install a python and for interpreting the python function etc.
It is possible using xlloop. This is a customized client-server approach, where the client is an excel .xll which must be installed on client's machine.
The server can be written in many languages, including python, and of course it must be launched on a server that has python installed. Currently the .xll is available only for 32 bits.
This might not be exactly what you're looking for (i.e.- "without python"), but you could ship it as a virtualenv .zip folder with all the necessary packages and respective python installation included in the folder... and also include a run.command bash executable inside the folder that the user can click on to run your program. You'll have to tell the user (inside a README.txt or something) how to enable the executable... For a particular application mine looked like...
Please complete the following steps after installation of MyApplication.zip:
Step 1: Move the MyApplication folder to your Desktop.
Step 2: Open your Terminal in Go then Applications then Utilities.
Step 3: In the Terminal, paste cd ~/Desktop/MyApplication
then press Enter.
Step 4: Then, paste chmod +x run.command
then press Enter.
From now on, clicking the “run” file in MyApplication will run the application.
If clicking the “run” file still doesn’t work, then do…
Click Ok on the popup then Open System Preferences then Security & Privacy
then Click on Open Anyway button then Click Open button on the popup.
NOTE: Please do not move or delete the MyApplication folder, or any of its files.
Then my run.command executable looked like the following:
cd ~/Desktop/MyApplication
PATH=$PATH:$HOME/Desktop/MyApplication/lib/python2.7/site-packages:$HOME/Desktop/MyApplication/lib/python2.7/site-packages/aeosa:$HOME/Desktop/MyApplication/lib/python2.7/lib-dynload:$HOME/Desktop/MyApplication/lib/python2.7/lib-old:$HOME/Desktop/MyApplication/lib/python2.7/lib-tk:$HOME/Desktop/MyApplication/Extras/lib/python:$HOME/Desktop/MyApplication/lib/python2.7/plat-mac/lib-scriptpackages:$HOME/Desktop/MyApplication/lib/python2.7/plat-mac:$HOME/Desktop/MyApplication/lib/python2.7/plat-darwin:$HOME/Desktop/MyApplication/lib/python2.7:$HOME/Desktop/MyApplication/lib/python27.zip
source bin/activate
python main.py
Three things are important here:
1) In run.command, I first change directory into the virtualenv I created for this project. I'm not trying to be dynamic here, since this is all just a quick hack of a solution, so as part of the README.txt, I simply tell the user to put the folder they downloaded onto their desktop. Otherwise, the cd command wouldn't work.
2) I set the client's PATH variable, separating entries with colons. You can see a list of the paths you'd need using a quick check on your computer...
import sys
for path in sys.path:
print path
3) I then call source bin/activate to activate the virtualenv.
4) I then execute my main.py file, which is in the top level of my virtualenv, along with run.command.
5) I only wrote this bash file for Mac OS X, so I don't know how it would translate to windows PCs. I think the only thing that'd change is that the path literals would need to use backslashes instead of forward slashes, but again, I haven't done this for windows so I'm uncertain.
Read more about setting up a virtualenv here: https://virtualenv.readthedocs.org/en/latest/index.html
Finally, note that you will not be able to send your final, working .zip folder over most email services, since they tend to prevent people from sending executables back and forth, so you'll have to use a service like Dropbox or something to send it to people.

iexpress assistance for my program

ok so i've used iexpress a few times without a problem. i created a nice little program for my buddies and i and i'm now in the process of creating a installation package for it. i like iexpress cause it makes it easy and has the license agreement window n whatnot.
ok so program is made. using windows & iexpress i attempt to make the installer, problem is there is one folder that contains an item i need and it needs to be in that folder directory when the installed program needs to run. Problem: i can select files but not folders for the list of items to be in the installer.
Question: how do i include the folder in the install package so there doesnt need to be a few more additional steps for the installation.
i have thought about zipping it, but there isnt a way (that i know of) to add a extract command after the initial install extract.
i figure installers are to programs what instruction booklets are to Ikea furniture so i figured this would be the best place for help. tyvm
iexpress doesn't let you include folders, but you can include a batch file, which may create folders and copy files to the respective folder. To run a batch file, specify cmd /c IncludedBatchFile.bat under Install Program in the iexpress wizard.

What scripts would go into a bin folder of a Python package?

I'm learning about Python Packages from Learn Python the Hard Way and one of the exercises it says:
Put a script in the bin directory that you can run
To me, it seems kind of vague. I'm not exactly sure what kind of scripts would go into the bin folder. The Hitchhiker's Guide to Packaging says
put into bin any scripts you’ve written that use your package and which you think would be useful for your users. If you don’t have any, then remove the bin directory.
But I'm still left wondering what kind of script would go in there. So, I know its may sound like a dumb question, but can someone give me an example of when, and why one would put "a script" in their package's bin folder?
I just recently got through Ex46 in LPTHW myself. Like you, I was confused by the scripts. In case the other answer was too advanced for you, I ended up just putting in a simple "hello world" script:
#!/usr/bin/env python
from test3 import printstring
printstring.printstring("test script working")
print "test over"
I named that file testscript3.py (*Note, I learned later that it would be more convenient to leave off the .py filename extension if it were a real script that I wanted to seem like a system command)
My file test3.py was like so:
def printstring(s='you did not provide string'):
print s
Here's some newbie things that I learned while trying to get this process to work:
The #! symbol is sometimes pronounced shebang and the simple explanation is that the command on that line tells the shell to use python to run the script. If you leave off the ".py" filename extension, then the user of the script doesn't need to care what interpreter is needed to run the script. See wikipedia shebang article.
I ran the following command to package the distribution:
python setup.py sdist
After doing that, I was able to install the package and script by running
sudo pip install test3-0.1.tar.gz
One thing I worried about was permissions on the script file. However, I noticed that distutils took care of this when packaging (changed mode to 755 or whatever).
You can find my whole project for this example on github.
For example Django's project creating, Scrapy's project creating, django-admin.py and scrapy are both scripts in bin folder.
You could get even more examples by checking almost python-based tools.

Categories