Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

slight change to earlier plan. Not overwriting daily. Need a time to …

…bless and overwrite
  • Loading branch information...
commit 03b119760100a7031a4604eba493c03729ca16a3 1 parent d427e88
@bentut authored
View
2  app/models/prognoz_data_file.rb
@@ -58,7 +58,7 @@ def get_data_for(series_name, output_spreadsheet = nil)
def output_path
output_filename = filename.split("/")[-1]
- "/Volumes/UHEROwork/data/prognoz_export/" + output_filename
+ "/Volumes/UHEROwork/data/prognoz_export/exports/" + output_filename
end
def write_export
View
5 lib/tasks/INVESTIGATE.rake
@@ -39,11 +39,12 @@ task :gen_prognoz_diffs => :environment do
diff_hash = ddiff[:display_array]
diff_data.push({:pdf_id => pdf.id, :id => header.ts.id, :name => header, :display_array => diff_hash}) if diff_hash.count > 0
end
- filenames.push pdf.filename
+ filenames.push pdf.filename.gsub("/prognoz_export/","/prognoz_exports/exports")
+ pdf.write_export
puts "#{"%.2f" %(Time.now - t1)} | #{pdf.filename}"
end
- Zip::ZipFile.open(folder+Date.today.strftime("%yM%mD%d")+".zip", Zip::ZipFile::CREATE) do |zipfile|
+ Zip::ZipFile.open(folder + "ready_to_send_zip_files/" + Date.today.strftime("%yM%mD%d") + ".zip", Zip::ZipFile::CREATE) do |zipfile|
filenames.each {|fname| zipfile.add(fname.split("/")[-1], fname)}
end
View
42 lib/tasks/exports.rake
@@ -37,27 +37,27 @@ task :tsd_exports => :environment do
end
#redundant with prognoz diffs. Can delete, most likely
-task :prognoz_exports => :environment do
- t = Time.now
-
- folder = "/Volumes/UHEROwork/data/prognoz_export/"
- filenames = ["Agriculture.xls", "CAFRCounties.xls", "Kauai.xls", "metatable_isdi.xls", "SourceDoc.xls", "TableTemplate.xls"]
- filenames.map! {|elem| folder+elem}
-
- PrognozDataFile.all.each do |pdf|
- t1 = Time.now
- pdf.write_export
- filenames.push pdf.filename
- puts "#{"%.2f" %(Time.now - t1)} | #{pdf.filename}"
- end
-
- Zip::ZipFile.open(folder + "ready_to_send_zip_files/" + Date.today.strftime("%yM%mD%d") + ".zip", Zip::ZipFile::CREATE) do |zipfile|
- filenames.each {|fname| zipfile.add(fname.split("/")[-1], fname)}
- end
-
- CSV.open("public/rake_time.csv", "a") {|csv| csv << ["prognoz_exports", "%.2f" % (Time.now - t) , t.to_s, Time.now.to_s] }
-
-end
+# task :prognoz_exports => :environment do
+# t = Time.now
+#
+# folder = "/Volumes/UHEROwork/data/prognoz_export/"
+# filenames = ["Agriculture.xls", "CAFRCounties.xls", "Kauai.xls", "metatable_isdi.xls", "SourceDoc.xls", "TableTemplate.xls"]
+# filenames.map! {|elem| folder+elem}
+#
+# PrognozDataFile.all.each do |pdf|
+# t1 = Time.now
+# pdf.write_export
+# filenames.push pdf.filename
+# puts "#{"%.2f" %(Time.now - t1)} | #{pdf.filename}"
+# end
+#
+# Zip::ZipFile.open(folder + "ready_to_send_zip_files/" + Date.today.strftime("%yM%mD%d") + ".zip", Zip::ZipFile::CREATE) do |zipfile|
+# filenames.each {|fname| zipfile.add(fname.split("/")[-1], fname)}
+# end
+#
+# CSV.open("public/rake_time.csv", "a") {|csv| csv << ["prognoz_exports", "%.2f" % (Time.now - t) , t.to_s, Time.now.to_s] }
+#
+# end
# task :prognoz_exports => :environment do
# t = Time.now
# DataList.write "prognoz_month1", "/Volumes/UHEROwork/eis/data/12M09Atest/Data_month1.xls"
Please sign in to comment.
Something went wrong with that request. Please try again.